COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-8
Linkfiles as Libraries
Linkfiles as Libraries
A linkfile can serve as your TNS user library (for the COBOL85 compiler) or user library
(for the NMCOBOL compiler). A link file cannot be executed as a process, due to its
lack of a main program; however, the code in the file can be executed.
To call utility routines from a user library, use CALL or ENTER statements (see CALL
and ENTER). CALL and ENTER statements allow you to specify the user library that
contains the routine you want to call. If you do not specify the user library in the CALL
or ENTER statement, the compilers resolves the references to the external routines as
explained in How the Compiler Resolves Unqualified References.
System Library
System library content is determined at system generation (SYSGEN). System library
routines run in the system code space.
For a TNS program, the file COBOLLIB can be configured into the system library.
(Alternatively, it can be configured into the user library or made available to Binder to
enable you to bind it into your own object files.)
TNS User Library
This section applies only to the COBOL85 compiler. A native HP COBOL program
uses a user library (see User Library).
A TNS user library contains routines that the operating environment binds to the
loadfile (run unit) at run time. Run-time binding does not include copying the routines
from the TNS user library into the loadfile. A loadfile can have only one TNS user
library associated with it.
An HP COBOL program can call routines contained in a user library that are written in
HP C, HP C++, FORTRAN, Pascal, and TAL. In the CRE, programs written in
HP COBOL can also be called.