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-15
Binding With BIND
In Example 24-2, the ADD command adds all the code and data blocks from BIGOBJ
to the BIND lists, the REPLACE command replaces all the code and data blocks in the
BIND lists that match blocks in OPART7, the BUILD command builds a new object file
named NUBIGOBJ, and the EXIT command exits BIND.
To direct BIND to use an OBEY command file, either start the BIND process with a
RUN command that specifies the OBEY command file as the IN file, or use an OBEY
command that specifies the OBEY command file to the executing BIND process. For
more information about OBEY command files, see the Guardian Users Guide.
Replacing a Code Block With One From Another Language
BIND allows you to replace one code block with another without regard for the
language attribute of either. This is a potential source of problems, because not all
languages have the same protocol for passing string parameters.
HP COBOL uses the TAL protocol for passing string parameters; that is, HP COBOL
passes only the character-string (by reference), not its length. FORTRAN uses its own
FORTRAN protocol, passing a CHARACTER parameter and its length.
If you use BIND to replace an HP COBOL code block (or any code block that uses TAL
protocol) with a FORTRAN code block, any CHARACTER parameters will not have the
associated lengths that the FORTRAN routine expects.
The reverse case—replacing a FORTRAN code block with an HP COBOL code block
(or any code block that uses TAL protocol)—is not a significant problem. The additional
stack locations used for string-length values waste some stack space, but are ignored.
Example 24-1. Interactive BIND Session
:BIND
Binder - OBJECT FILE Binder - T9621D20 - (8JUN92) SYSTEM \AB
@ADD * FROM BIGOBJ
@REPLACE * FROM OPART7
@BUILD NUBIGOBJ
@EXIT
Example 24-2. OBEY File Equivalent of Example 24-1
1 ADD * FROM BIGOBJ
2 REPLACE * FROM OPART7
3 BUILD NUBIGOBJ
4 EXIT