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-39
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
Load Maps
Compilation Summary
With compiler directives, you can include one or more of these in the compiler listing:
Symbol Table Listing
Octal Code Listing
Symbolic Code Listing
Cross-Reference Listing
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).