COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
and does not try to locate the program for that CALL. You are responsible for the conformance of
the parameters.
A compilation source text consists of one or more separately compiled HP COBOL programs. Each
such program can include nested programs. Suppose separately compiled program S includes
program P, which contains the statement CALL A. The compiler follows this procedure:
1. If program P directly contains a program named A, the compiler always chooses that program.
In Example 150, the compiler issues a warning if a file-mnemonic appears.
2. If program S contains a common program named A, and also contains (directly or indirectly)
program P, then if P calls A, the compiler chooses the common program A.
In Example 151, the compiler issues a warning if a file-mnemonic appears. If common
program A contains program P (directly or indirectly), the compiler leaves P’s reference to A
unresolved, and item 4 applies.
3. If neither item 1 or item 2 apply, and a previously seen separately compiled program has the
name A, the compiler chooses that program.
4. If item 1, item 2, and item 3 do not apply, the compiler conducts a search for program A.
If file-mnemonic appears, the compiler tries to find a separately compiled program unit
in the file associated with the file-mnemonic. If the compiler cannot find such a program
unit, it reports an error and delivers no object code for program S to the target file.
If the compiler finds no separately compiled program A in the object files of the search lists,
the compiler expects a separately compiled program A to appear somewhere within the source
text, and also expects all of program A’s parameters to have EXTENDED-STORAGE access
mode (the default).
If the compiler does find a program unit for A in the search lists, it resolves the reference with
the first such program unit in the list. If the compiler discovers a separately compiled program
A later in the source text, it replaces its previous resolution with the new one. If the new program
A and the original program A have different numbers of parameters, or if their parameters
have different access modes, the compiler reports an error and delivers no object code for
program A to the target file.
Compilation Details 519










