ContentsIndexPreviousNext

2.9 Calling Subprograms

ACUCOBOL-GT is not a linked language. Instead, when a subprogram is called, it is loaded dynamically at runtime. ACUCOBOL-GT does not use the name specified in the PROGRAM-ID paragraph. Instead, the name specified in the CALL statement is treated as a file name of the object file to load. Actually runcbl maintains two names for each called object file: its call name (the exact name specified in the CALL statement) and its file name (the name by which the object file is actually found).

An object module can be in one of three states:

1. Active. This is the state of any program that has been called but has not yet exited. It also applies to the first (or main) program of a run unit. An active program is always memory resident.

2. Loaded but inactive. A loaded program is one that is memory resident but not running. This is the state of a program that has been called and has also exited. It remains in memory until it is the object of a CANCEL verb. A program in this state keeps its files and data items in the same state that they were in when the program exited. Note that programs with the initial attribute are never in this state because they are automatically canceled when they exit.

3. Not loaded. This is the initial state of all object files. It indicates that the program is not in memory.

More:

CALL

CANCEL

CHAIN