ContentsIndexPreviousNext

3.2 PROGRAM-ID Paragraph

General Format

PROGRAM-ID.  program-name [ IS {INITIAL } PROGRAM ] .
                               {RESIDENT}

Syntax Rules

1. Program-name is a user-defined word or a reserved word. It must be unique among separately compiled programs. If a reserved word is used, it is treated as if it were not reserved.

""""General Rules

1. The program-name identifies the name of the program. It is used by the ACUCOBOL-GT runtime system and debugger to identify a program.

2. The INITIAL PROGRAM clause specifies an initial program. Whenever an initial program is called, it is placed in its initial state. Data contained in an initial program is set to its starting value every time the program is called.

3. Files contained in the program are not in the open mode:

a) the first time the program is called,

b) the first time the program is called after it has been the target of a CANCEL statement,

c) every time the program is called if it is an initial program.

4. On all other entries, the files contained in the program are in the same state and position as when the program last exited.

5. Initial programs are removed from memory when they exit. Non-initial programs remain in memory until they are the targets of a CANCEL statement.

6. The RESIDENT clause specifies that the program is to remain resident in memory after its first execution. A program with the RESIDENT clause cannot be affected by a CANCEL statement. Note that the RESIDENT clause shields selected programs from the effects of a CANCEL ALL statement.

7. Please note that the IBM DOS/VS COBOL "-Cv" compatibility mode allows the name to be enclosed in quotation marks. See the IBM DOS/VS COBOL appendix for more information.