COBOL Manual for TNS and TNS/R Programs

HP COBOL Manual for TNS and TNS/R Programs522555-006
11-1
11 Program Compilation
Throughout this section, “compiler” means both the COBOL85 and NMCOBOL
compilers unless otherwise stated.
The compiler can run at a high PIN (a process identification number greater than 255)
and can be requested by other processes running at high PINs.
The compiler accepts one source file as input. That source file can use SOURCE
directives and COPY statements to read text from other source files. The source file
that is input to the compiler and the source files from which it reads text can contain
one or more source programs, each consisting of HP COBOL statements, comment
lines, and compiler directives (instructions to the compiler). Compiler directives can
also appear on the compiler command line.
Compiler directives specify the source format, control listing features, control selective
compilation of portions of the source code, and request compilation options; therefore,
they affect the output of the compiler. By default, if the source file has no errors, the
compiler outputs a listing and an object file.
The NOLIST and SUPPRESS directives can suppress all or parts of the listing file.
The COBOL85 compiler produces an object file that can be both executed and input to
the Bind utility. The NMCOBOL compiler produces an object file that can either be
input to the nld utility (the default), input to the ld utility, or executed.
The SYNTAX directive can suppress all or parts of the object file. Syntax errors in the
source file can also suppress all or parts of the object file:
The rest of this section applies primarily to the Guardian environment. If you are
compiling HP COBOL programs in the OSS environment, see Section 19, Using
HP COBOL in the OSS Environment.
Syntax errors are in: COBOL85 produces: NMCOBOL produces:
All programs in the compilation No object file No object file
Some programs in the compilation Partial object file No object file
No programs in the compilation Complete object file Complete object file