COBOL Manual for TNS and TNS/R Programs
Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
22-13
Compiling an HP COBOL Source Program
Compiling an HP COBOL Source Program
The COBOL85 and NMCOBOL compilers translate HP COBOL source programs into
machine language.
The COBOL85 compiler interacts with Binder, which collects any additional object
programs needed to satisfy external references and validates any calls to routines that
are part of the operating environment or are to be executed in a TNS user library.
The NMCOBOL compiler does not interact with the ld utility, but if you specify the
CALL-SHARED and RUNNABLE directives, and there are no compilation errors, the
NMCOBOL compiler calls the ld utility, which produces a PIC loadfile. If you specify
the SHARED and RUNNABLE directives, and there are no compilation errors, the
NMCOBOL compiler calls the ld utility, which produces a DLL.
From the user’s viewpoint, compilation is a single-step process. (If you are interested
in the details of the compilation process, see Compilation Details.
Topics:
•
Running the Compiler
•
Naming the Object File
•
Specifying the Default COPY Library
•
Specifying Compiler Directives
•
Specifying Subvolumes to Be Searched for Unqualified Files
•
Changing the Compilation Environment
•
Improving Compilation Speed
•
Launching Compilations to Run Unattended
Running the Compiler
To run the COBOL85 or NMCOBOL compiler, use the COBOL85 or NMCOBOL
command. Specify the name of the file containing the source program or programs that
you want to compile; for example:
23> COBOL85 /IN XYZ/
23> NMCOBOL /IN XYZ/
Caution. (This applies only to the COBOL85 compiler.) If the file C8LIB, the run-time library, is
present in the same subvolume as the compiler, the run-time routines are bound into the
object. This feature can cause the object to be as much as 10 times larger than it would
otherwise be; it can also cause failures and other serious problems when running on systems
other than the one on which the program was compiled. This feature is intended for use by
HP COBOL developers and support groups only.