Binder Manual (G06.27+, H06.04+, J06.03+)
User Libraries
Binder Manual—528613-004
6-3
Specifying a User Library
Specifying a User Library
Only one user library can be associated with a program file at any time. Therefore, all
concurrently executing processes created from a single program file use the same
library file.
You specify the user library for a program file by using one of the following:
•
The COBOL85, FORTRAN, and TAL compiler directive LIBRARY
•
The Binder command SET LIBRARY
•
The command interpreter RUN command LIB option
The Binder SET LIBRARY command overrides any LIBRARY compiler directives. The
RUN command LIB option overrides both the Binder SET LIBRARY commands and
the LIBRARY compiler directives.
The library remains associated with the program file until you explicitly change it. That
is, the operating system changes to the program file for external-reference resolution
remain when the process completes. If the operating system detects modifications to
the program file or the user library when either file is specified in a subsequent RUN
command, the operating system again resolves the calls left for resolution.
See the BUILD Command on page 3-11, CHANGE Command on page 3-15, and SET
Command on page 3-57 to learn how to specify and change user libraries.
To specify a different library with a program file, you need write access to the program
file, and all processes created from the program file must have stopped.
Restrictions on User Libraries
The SELECT CHECK LIBRARY ON command directs Binder to enforces rules to
which user libraries must adhere. Specify this command when building a target file that
will be used as a user library. Binder issues a warning for any reference to a data block
other than a read-only block or any entry point that has the MAIN attribute. Note that
BIND does not check existing libraries, only user libraries that are being built.
User library files must meet the following restrictions:
•
A library file cannot contain a main program. If it does, a run-time error results.
•
Library routines cannot call routines in the program file.
•
FORTRAN user libraries cannot contain DATA statements, SAVE statements, or
COMMON statements.
•
C user library routines can be called by routines written in any HP programming
language, but the calling program file must contain at least one C routine. This is
required to ensure the C run-time library resources are available to the user library.
Additionally, user library files must meet the following restrictions on data declarations: