COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-14
CALL and ENTER Statement Processing: Overview
Topics:
•
Primary Search List
•
Secondary Search List (COBOL85 Compiler Only)
•
Tertiary Search List
•
COBOLEXT File
•
COBOLEX0 and COBOLEX1 Files
•
NMCOBEXT File
•
NMCOBEX0 and NMCOBEX1 Files
Primary Search List
SEARCH directives define the primary search list, an ordered list of object files. Each
SEARCH directive adds one or more files to the primary search list. The compiler adds
files to the search list in the order that they appear in the SEARCH directives. When
trying to resolve unqualified external references, the compiler searches the files of the
primary search list in the order that they appear. If the compiler resolves an external
reference from the primary search list, the object program that the compiler finds is
bound into the target file.
Secondary Search List (COBOL85 Compiler Only)
The LIBRARY directive defines the secondary search list, which consists of one file.
Whenever the compiler encounters a LIBRARY directive, the object file named there
becomes the new secondary search list. If a program is compiled with more than one
LIBRARY directive, the one that applies to a specific ENTER statement is the last one
the compiler encountered prior to that ENTER statement. If the compiler resolves an
external reference from the secondary search list, the object program that the compiler
finds is not bound into the target file. Programs resolved from the secondary search list
are presumed to be in a user library.
Tertiary Search List
CONSULT directives define the tertiary search list. Each CONSULT directive adds one
or more files to the tertiary search list. The compiler adds files to the search list in the
order that they appear in the CONSULT directives. When trying to resolve unqualified
external references, the compiler searches the files of the tertiary search list in the
order that they appear. If the compiler resolves an external reference from the tertiary
search list, the object program that the compiler finds is not bound into the target file.
Programs resolved from the tertiary search list do not have to be in the system library.
They can be elsewhere and can be bound in later or can be referenced in a run-time
library.