COBOL Manual for TNS and TNS/R Programs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
10-1
10 Source Text Manipulation
Source manipulation comprises the COPY statement, COPY libraries, and the
REPLACE statement. You can use the COPY and REPLACE statements in any
division of the source program.
The COPY statement summons source text from a COPY library and delivers merged
text to the compiler. Its optional REPLACING phrase replaces every occurrence of a
specified portion of library text with a specified portion of new text when it copies library
text into a source program. You can specify more than one such replacement pair in a
REPLACING phrase. With or without the REPLACING phrase, the COPY statement
does not change the COPY library or the source file.
The COPY statement appears in the listing unless a NOSHOWCOPY, NOLIST, or
SUPPRESS directive is active. The library text appears in the listing unless a NOLIST
or SUPPRESS directive is active.
In the Guardian environment, a COPY library is a file in the EDIT format. It contains
one or more sections of zero or more text lines, each preceded by a SECTION
directive line and succeeded by either another SECTION directive line or the end of the
file.
In the OSS environment, a COPY library is an ASCII text file.
The REPLACE statement replaces source program text. It is useful for establishing
names for constants and abbreviations for words and phrases and for overcoming the
introduction of new reserved words into the language.
Topics:
•
COPY Statement
•
REPLACING Phrase
•
COPY Libraries
•
REPLACE Statement