COBOL Manual for TNS and TNS/R Programs

Program Compilation
HP COBOL Manual for TNS and TNS/R Programs522555-006
11-28
Manipulating Object Files
An object program is the portion of an object file produced from one program unit. An
object file contains one or more object programs. Within the object file, each object
program maintains its identity, but is discernible only as a family of code blocks and
data blocks.
Any object file produced by either BIND or BINSERV can serve as object-file input
either for BIND during an interactive session or for BINSERV during a COBOL85
compilation. This means that, using BINSERV, the COBOL85 compiler can include
object programs from object files created by previous COBOL compilations. To
distinguish between the object files that are input to BIND or BINSERV and the final
output object file, the final output object file is called the target file.
By including object programs from object files in a target file, you can construct
collections of blocks in object files that are then used as program libraries. Because the
term “library” as applied to object files has a particular meaning for NonStop systems,
this manual uses the terms “object file” and “target file” to refer to such collections of
object programs.
An HP COBOL program unit can also contain ENTER statements that call HP C,
HP C++ FORTRAN, Pascal, and TAL routines. BINSERV fetches these from object
files created by the HP C, HP C++, FORTRAN, Pascal, and TAL compilers (which also
use BINSERV as a Binder server process).
For more information on Binder, see the Binder Manual.
Manipulating Object Files
You can use a TNS HP COBOL, TNS HP C, TNS HP C++, FORTRAN, Pascal or TAL
object file as input to the BIND utility to create a new target file. Using BIND, you can
add, delete, or replace code blocks and data blocks compiled from HP C, HP C++,
FORTRAN, Pascal, or TAL source files. For details, see the Binder Manual.
You can use a TNS/R HP COBOL, TNS/R HP C, TNS/R HP C++, or pTAL object file as
input to the linker to create a new target file. Using the linker, you can add code blocks
and data blocks compiled from TNS/R HP COBOL, TNS/R HP C, TNS/R HP C++, or
pTAL source files. For details, see the nld Manual or ld Manual.
Note. In the non-CRE environment, if any object program in an object file is a COBOL
program, the main program of that object file must also be a COBOL program. Also, if any
object program in an object file was compiled by the COBOL85 compiler, the main program of
that object file must also have been compiled by the COBOL85 compiler.
In the CRE, if any HP COBOL object program in an object file was compiled with ENV
COMMON or ENV LIBRARY, you must compile all HP COBOL object programs in that object
file with ENV COMMON or ENV LIBRARY.