COBOL Manual for TNS and TNS/R Programs
Issues Related to Binding and Linking
HP COBOL Manual for TNS and TNS/R Programs—522555-006
24-2
Code and Data Blocks
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.
Figure 24-1. Code and Data Blocks
Compiler
Separately compiled program A
Separately compiled program B
Nested program C
Nested program D
Code
Block
B
Code
Block
C
Code
Block
D
Code
Block
A
Data
Block
Data
Block
Data
Block
Data
Block
Data
Block
VST702.vsd