COBOL Manual for TNS and TNS/R Programs

Program Compilation
HP COBOL Manual for TNS and TNS/R Programs522555-006
11-73
ENV
Topics:
Library Programs
ENV and Compatible Programs
Library Programs
If you are using the non-CRE or OSS environment, you cannot put an HP COBOL
routine in the user library (because you cannot compile it with the ENV LIBRARY
directive).
If you are using the CRE, you can compile an HP COBOL program with the ENV
LIBRARY directive and put it into a user library if the program satisfies these criteria:
It is not a main program.
It is an initial program (its PROGRAM-ID paragraph specifies INITIAL).
It is a separately compiled program (it is not embedded in another program).
It does not contain any other programs.
It does not specify the GLOBAL phrase on any level-01 record descriptions.
It does not reference any external data items or external files.
It does not have an Extended-Storage Section.
It does not have a PROGRAM COLLATING SEQUENCE clause.
It does not contain SQL/MP statements.
Table 11-20. Effects of ENV Directive Options
ENV Option
COBOL85 Compiler
NMCOBOL Compiler
Guardian
Environment OSS Environment
COMMON Selects CRE Selects CRE (required) Accepted but
unnecessary (CRE is the
default)
LIBRARY Selects CRE and
allows program to be
put in a user library.
Program must satisfy
the criteria in Library
Programs
Not accepted Ignored, warning issued *
OLD Selects non-CRE
environment
Not accepted Not accepted
* To build a user library, use UL.
Note. This topic applies only to the COBOL85 compiler.