COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-43
Starting a Compilation
Usage Considerations:
•
Compiler on D-Series System and Other Files on C-Series System
If the COBOL85 compiler is running on a D-series system and any other file that
the program uses (such as the source-file, a COPY or SOURCE library, a
search or consult file, the OUT file, the home terminal, or the target file) is on a
C-series system, then compiling with the HIGHPIN directive causes a compilation
error.
•
COBOL85 Compiler’s Construction of Target File
The COBOL85 compiler (through BINSERV) constructs the target file in a
temporary file of its own creation. If the compilation is successful, BINSERV purges
any existing copy of the named file and then renames the temporary file with the
chosen name. If the old copy was in use when BINSERV tried this, that old copy is
renamed, and the temporary file is renamed with the chosen name.
If a file exists with the same name as target-name (or RUNUNIT, if applicable),
the compilation tries to purge the old file. If it cannot purge the old file, its behavior
depends on whether the purge fails because the old object file is then executing
(Guardian file-system error 12).
°
If the old object is not executing, the compilation tries to rename the temporary
file OBJECT. If that renaming operation fails (because there already is a file
named OBJECT), the compilation creates a special name of the form
ZZBInnnn, where nnnn is a random number.
°
If the old object is executing, the compilation renames the old object file to the
special name of the form ZZBInnnn and renames the temporary file with the
value of target-name.
Examples of Commands That Run the Compilers
Each of these commands initiates compilation of the program contained in MYSRC (on
the default system, volume, and subvolume), directing the listing to $SPOOL (a spooler
collector):
COBOL85 /IN MYSRC,OUT $SPOOL,PRI 140/MYPROG;ICODE;LMAP *
NMCOBOL /IN MYSRC,OUT $SPOOL,PRI 140/MYPROG;INNERLIST
The compiler is to run at a priority of 140. The name of the target file, if the compilation
succeeds, is to be MYPROG on the default system, volume, and subvolume. Two
directives specify that a listing of the mnemonic version of the generated code and a
complete set of load-map listings are to be produced.