COBOL Manual for TNS/E Programs (H06.03+)

Calling Other Programs and Routines
HP COBOL Manual for TNS/E Programs520347-003
23-4
Common Programs
An HP COBOL program can call any program directly contained within itself and any
other separately compiled program. It cannot call a program indirectly contained within
itself. The programs in Figure 23-1 can call each other:
Common Programs
If a program has the COMMON clause in its Identification Division, it is called a
common program, and it can be called by any program directly or indirectly contained
in the program that directly contains it. In Figure 23-1, if Aaa, Bbb, and Ccc are
common, the programs in Figure 23-1 can call each other:
You gain no performance benefits by making Ddd common.
Initial Programs
If a program has the INITIAL clause in its Identification Division, it is an initial program.
Its program state is initialized whenever it is called. The data in its Working-Storage
Section is allocated when it is called rather than being statically allocated. For more
information about initial programs, see Initial Programs.
The program ...
Can call the program ...
Mane Aaa Bbb Ccc Ddd Sub
Mane X X X
Aaa X
Bbb X X
Ccc X X
Ddd X
Sub X
The program ...
Can call the program ...
Mane Aaa Bbb Ccc Ddd Sub
Mane X X X
Aaa X X
Bbb XXX
Ccc X X X X
Ddd XXX X
Sub X