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-18
Separate Programs
The maximum size of a code block depends on the language. The maximum size of an
HP COBOL code block is 128 KB minus the number of bytes that the PEP and XEP
tables occupy. If any HP COBOL code block in a segment exceeds 64 KB, the PEP
table for that segment is automatically allocated 1024 bytes.
If your program does not fit in one code block, do one or more of:
Design the program as a family of Separate Programs
Design the program as a family of Separate Processes
Put eligible routines into a file, compile it, and declare it the TNS User Library
Compile the program with the directive LESS-CODE 1
(see LESS-CODE Directive)
It is easier to design a program as a family of separate programs or processes than it
is to design a large, monolithic program only to find that it does not fit into one code
block, and you must break it into separate programs or processes.
Separate Programs
If you can divide your programming task into a group of HP COBOL programs, one
program can use the CALL statement to call others, and the programs can share
resources. (For information about how programs share resources, see How Programs
Share Resources.)
You can compile the individual programs as separately compiled programs in a single
compilation, or you can compile them in multiple compilations and then use BIND to
bind them.
Figure 24-4. Run Unit Containing HP COBOL Code Blocks
Code Block
PEP Table
XEP Table
Code Segment
Code Block
PEP Table
XEP Table
Code Segment
Code Block
PEP Table
XEP Table
Code Segment
Up to 16
...
Up to 64K
words
Code Block
Code Block
Code Block
VST705.vsd