COBOL Manual for TNS and TNS/R Programs

Program Compilation
HP COBOL Manual for TNS and TNS/R Programs522555-006
11-17
CALL and ENTER Statement Processing: Detailed
Explanation
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 11-6, 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 applies, 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 no file-mnemonic appears, the COBOL85 compiler consults the search lists.
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.
5. When the compiler reaches the end of the source text, it issues a warning if it was
unable to resolve any program references. You must supply the missing programs
(using BIND or the linker) before you execute the loadfile.