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

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS/E Programs520347-003
22-35
Replacing Text-Words From SOURCE Libraries
Replacing Text-Words From SOURCE Libraries
If a REPLACE statement is active when the compiler encounters a SOURCE directive,
the REPLACE statement applies to the copy of the library text that the compiler
includes in the HP COBOL source program (but not to the original text in the SOURCE
library).
Understanding and Controlling the Compiler
Listing
By default, the compiler produces a listing that includes:
Compilation Banner
Source Program Listing
Compilation Summary
With compiler directives, you can include one or more of these in the compiler listing:
Symbol Table Listing
Symbolic Code Listing
Compiler directives also allow you to suppress parts of the compiler listing (see
Table 22-1).
The minimum compiler listing, produced when you compile a program with the
SUPPRESS directive, includes only a banner, any diagnostics and the source lines
that caused them, and a summary.
Example 22-12. Replacing Text-Words From a SOURCE Library
Source code:
REPLACE ==OFFICES== BY ==10==
==SQ-FT-SIZE== BY ==5==
?SOURCE SRCFILE
REPLACE OFF
Lines in SOURCE library:
01 OFFS.
03 OFFICE-INFO OCCURS OFFICES TIMES.
05 DISTRICT PICTURE 99.
05 SQUARE-FEET PICTURE S9(SQ-FT-SIZE).
Resulting source code (SOURCE library is unchanged):
01 OFFS.
03 OFFICE-INFO OCCURS 10 TIMES.
05 DISTRICT PICTURE 99.
05 SQUARE-FEET PICTURE S9(5).