COBOL Manual for TNS and TNS/R Programs

Issues Related to Binding and Linking
HP COBOL Manual for TNS and TNS/R Programs522555-006
24-3
Code and Data Blocks
These compilers also produce one object file per compilation unit:
TNS HP C
TNS HP C++
FORTRAN
Pascal
TAL
Native (TNS/R and TNS/E) HP C
Native (TNS/R and TNS/E) HP C++
pTAL
The object file contains one relocatable code block for each procedure and zero or
more data blocks.
How One Code Block Calls Another
At the source program level, one program calls another with a CALL or ENTER
statement; at the object program level, the calling program’s code block calls the called
program’s code block.
A CALL statement calls another COBOL program. Each CALL statement in a
compilation unit makes either an internal reference (calling another program in the
compilation unit) or an external reference (calling a program that is not part of the
compilation unit). In Figure 24-2, the first CALL statement makes an internal reference,
and the second CALL statement makes an external reference.
An ENTER statement calls a non-COBOL program. Each ENTER statement makes an
external reference.
Figure 24-2. Internal and External References
COBOL Source File
IDENTIFICATION DIVISION.
PROGRAM-ID. X.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
. . .
CALL "Y".
CALL "Z".
IDENTIFICATION DIVISION.
PROGRAM-ID. Y.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
Code
X
Data Data
COBOL Object File
Code
Y
Data Data
Internal ReferenceCompiler
External Reference (to Z)
VST703.vsd