COBOL Manual for TNS and TNS/R Programs

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs522555-006
22-14
Running the Compiler
The preceding NMCOBOL command produces a loadfile only if the source file, XYZ,
contains a RUNNABLE directive. If it does not, the command that produces a loadfile
is:
23> NMCOBOL /IN XYZ/; RUNNABLE
The file XYZ must be an EDIT or entry-sequenced file.
24> COBOL85 /IN XYZ/
24> NMCOBOL /IN XYZ/; RUNNABLE
The preceding commands deliver the compiler listing to your terminal. To send the
compiler listing to spooler collector $SPX for printing instead, you must specify the
OUT parameter:
25> COBOL85 /IN XYZ, OUT $SPX/
25> NMCOBOL /IN XYZ, OUT $SPX/; RUNNABLE
The preceding commands send the compiler listing to the default location of spooler
collector $SPX. To specify another location, such as #LPPR, include the location in the
OUT parameter:
26> COBOL85 /IN XYZ, OUT $SPX.#LPPR/
26> NMCOBOL /IN XYZ, OUT $SPX.#LPPR/; RUNNABLE
If spooler collector $SPX recognizes location #LPPR, the compiler listing is queued for
printing. If you want to examine the compiler listing before printing it, specify a fictitious
location, such as #XYZLST:
27> COBOL85 /IN XYZ, OUT $SPX.#XYZLST/
27> NMCOBOL /IN XYZ, OUT $SPX.#XYZLST/; RUNNABLE
Using the PERUSE utility, list the last page of the compiler listing (the last page is a
compilation summary). If the summary reports errors, use an HP editor to fix the
source program and then recompile it (remember to delete the compiler listing from the
spooler collector). If the summary does not report errors, change its location to an
existing printer. You delete the compiler listing from the spooler collector or change its
location to an existing printer from within the PERUSE utility. For information about the
PERUSE utility, see Using PERUSE
and the Guardian User’s Guide.
If you want to compile a source program without producing a listing file, specify an
empty OUT file for the COBOL85 compiler:
28> COBOL85 /IN XYZ, OUT /
The preceding commands cause any listing lines that the compiler generates to be
discarded. The NMCOBOL compiler does not accept an empty OUT file.
Note. For easier ways to check a program for syntax errors, see Directives for Syntax
Checking Only.