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

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 (page 516).
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 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 (page 906) and the Guardian User’s
Guide.
NOTE: For easier ways to check a program for syntax errors, see Directives for Syntax Checking
Only.
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
Compiling an HP COBOL Source Program 753