COBOL Manual for TNS and TNS/R Programs
Source Text Manipulation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
10-14
REPLACE Statement
•
Compiler Builds a Directory of the COPY Library
The first time the compiler reads from a COPY library, it begins to build a directory
for itself that enables it to locate the individual sections. It reads through the library,
building its directory, until it finds the selected section. After copying it, it resumes
normal compilation. For subsequent COPY statements, it checks its directory. If the
chosen section is in the directory, the compiler can go right to it; otherwise, it
resumes reading the library where it left off, and continues as before. If you put
sections that most programs use in the front of the library and those that few
programs use at the end, compilation speed is improved.
•
Adding Source Text to a COPY Library
Since COPY libraries are files in the EDIT format or OSS ASCII files, you can add
a section of source text to a library by editing it. You can put a SECTION directive
line and the source text that follows it before, between, or after sections already in
the library.
REPLACE Statement
REPLACE substitutes zero or more words of pseudo-text for one or more words of
pseudo-text.
REPLACE
is a reserved word that cannot be split across source program lines.
pseudo-text-1
contains at least one text-word other than a comma or semicolon separator. A
character-string within pseudo-text-1 can continue on the next line, but both
characters of the pseudo-text delimiter (==) must be on the same line.
REPLACE
OFF
pseudo-text-1 BY pseudo-text-2
.
VST254.vsd
==== text-word
VST250.vsd