COBOL Manual for TNS/E Programs (H06.03+)

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS/E Programs520347-003
22-13
Running the Compiler
Running the Compiler
To run the compiler, use the ECOBOL command. Specify the name of the file
containing the source program or programs that you want to compile; for example:
23> ECOBOL /IN XYZ/
The preceding ECOBOL 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> ECOBOL /IN XYZ/; RUNNABLE
The file XYZ must be an EDIT or entry-sequenced file.
24> ECOBOL /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> ECOBOL /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> ECOBOL /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> ECOBOL /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.
The compiler does not accept an empty OUT file.
To specify a file for information about any compilation errors or warnings, use the
ERRORFILE directive:
29> ECOBOL /IN XYZ, OUT $SPX.#XYZLST/; RUNNABLE; ERRORFILE EFILE
The error logging file is not an EDIT file. You can use it only with the FIXERRS TACL
macro. For more information about the FIXERRS macro, see FIXERRS Macro. For
more information about the ERRORFILE directive, see ERRORFILE.
Note. For easier ways to check a program for syntax errors, see Directives for Syntax
Checking Only.