COBOL Manual for TNS and TNS/R Programs

Source Text Manipulation
HP COBOL Manual for TNS and TNS/R Programs522555-006
10-11
COPY Libraries
COPY Libraries
A COPY library is either a file in the EDIT format or an OSS ASCII text file. Its text can
be merged into a source program during compilation using a COPY statement. If the
COPY statement contains a REPLACING phrase, specified portions of library text can
be replaced by specified new text when the COPY statement copies the library text into
the source program. With or without the REPLACING phrase, the COPY statement
does not change the COPY library.
Topics:
Specifying Library Names
Library Format
Specifying Library Names
There are three places you can specify the name of the library from which a COPY
statement is to collect text:
The COPY statement itself can include an IN library-name phrase (see COPY
Statement), in which the name can be a file-system file name or (in the Guardian
environment) an alphanumeric literal containing a DEFINE name.
The COBOL85 command that initiates the compilation can include a library name
to be used whenever a COPY statement does not include a library name (see
Starting a Compilation). On a command line, the library name parameter is either a
file-system file name or (in the Guardian environment) a DEFINE name, but neither
can be enclosed in quotation marks.
In the OSS environment, you can specify the default COPY library with the
-Wcopylib flag.
If no name is specified on either the command line or the COPY statement, the
compiler uses the name COPYLIB.
If library-name is not fully qualified with volume and subvolume, the current default
volume or subvolume is used.
Example 10-2. COPY Statement With REPLACING Phrases
COPY CUSTOMER REPLACING ==FULL NAME== BY ==Able X. Baker==
ADDRESS BY STREET-ADDRESS.