COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
24 Issues Related to Linking
NOTE: Most of this section applies to the Guardian environment. If you are binding HP COBOL
programs in the OSS environment, see Chapter 19: Using HP COBOL in the OSS Environment
(page 711) and Mixed-Language Programs (page 712).
Concepts and Terms
These the concepts and terms are relevant to linking:
• Memory Areas (page 600)
• Code and Data Blocks
• Linking
• Loadfiles, Linkfiles, and Processes
• Comment for Top of Page
Code and Data Blocks
The compiler accepts HP COBOL source code and produces code and data blocks. The code
blocks can call each other.
Topics:
• How the Compiler Produces Code and Data Blocks
• How One Code Block Calls Another
How the Compiler Produces Code and Data Blocks
To understand how the compiler produces code and data blocks from HP COBOL source code,
you must know about separately compiled programs and compilation units.
A separately compiled program is an HP COBOL source program that is not nested within any
other program. It can have other HP COBOL source programs nested within it.
A compilation unit is a collection of source statements presented to a compiler in one compilation.
It contains one or more separately compiled programs.
For each compilation unit, the compiler produces a single object file. For each separately compiled
program in the compilation unit, the object file contains one relocatable code block for the outermost
source program, one relocatable code block for each program nested inside the outermost source
program, and one or more data blocks. Each nest of programs produces an indivisible nest of
code blocks. In the object file, the code and data blocks exist solely as named code blocks and
data blocks; they do not have a collective identity.
812 Issues Related to Linking










