COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-13
CALL and ENTER Statement Processing: Overview
To generate the proper code to call a separately compiled program, the compiler needs
a description of the parameter list of that program. Each CALL or ENTER statement
can include qualification that specifies where the compiler must find the program.
Although the compiler must search for unqualified programs, qualification significantly
restricts the activity of the compiler.
Topics:
•
Qualified References
•
How the Compiler Resolves Unqualified References
Qualified References
Each CALL or ENTER statement can include a file-mnemonic that identifies the
object file where BINSERV or the linker must look for the called program, resolving the
external reference and including the called program’s object code in the target file. You
must associate this file-mnemonic with the object file’s file-system file name in the
SPECIAL-NAMES paragraph in the Environment Division that governs the calling
program. (Either the calling program is not nested, and contains an Environment
Division; or the calling program is nested, and its outermost containing program
contains an Environment Division.)
If the compiler does not find the program in the specified object file, it reports an error
and creates no code or data blocks for the program unit. Example 11-1 contains three
examples of qualified references.
How the Compiler Resolves Unqualified References
When a program name is not qualified and the program it names is not in the
compilation unit (such as the call to A-FRIEND in Example 11-1) the compiler resolves
the reference in one of these ways:
•
If you provided one or more search lists, the compiler examines those files in
sequence for program names that correspond to the external references.
•
If you did not provide search lists, or if the compiler did not find the necessary
external references on them:
°
The COBOL85 compiler examines COBOLEXT for resolution of TAL external
references and does not resolve FORTRAN external references at all.
°
The NMCOBOL compiler examines NMCOBEXT for resolution of external
references.
You create primary, secondary, and tertiary search lists with the SEARCH, LIBRARY,
and CONSULT directives, respectively. (The NMCOBOL compiler does not recognize
the LIBRARY directive or have a user library, the secondary search list.) You can also
use the predefined SEARCH DEFINEs to specify one or more subvolumes to be
searched for unqualified files (see Predefined SEARCH DEFINEs).