COBOL Manual for TNS and TNS/R Programs
Source Text Manipulation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
10-3
COPY Statement
If library-name is not specified, a default library file is selected:
•
In the Guardian environment:
1. If a COPY library is named in the COBOL85 command (see Starting a
Compilation), then that file is the default library file.
2. If the condition in Item 1 is not true and the file COPYLIB exists on the
current volume and subvolume, then that COPYLIB file is the default library
file.
3. If the conditions in Item 1 and Item 2 are not true and a DEFINE of class
SEARCH named =_SOURCE_SEARCH exists, then the default library file
is the first file named COPYLIB in the search list defined by
=_SOURCE_SEARCH. (See =_SOURCE_SEARCH.)
4. If none of the preceding conditions are true, the COPY statement is in
error.
•
In the OSS environment, the -Wcopylib flag specifies the default COPY
library.
If library-name is specified, these definitions apply:
system-file-name
is the name of an EDIT file (code 101), OSS ASCII text file (code 180), or PC
file. If system-file-name is a PC file name or does not begin with a dollar
sign ($), backward slash (\), or number sign (#), then it must be enclosed in
quotation marks unless it forms a COBOL word. For more information about
operating system file names, see the Guardian Procedure Calls Reference
Manual.
define-name-literal
is a nonnumeric literal that represents the name of a DEFINE of class MAP
that is associated with an EDIT file. Quotation marks must enclose define-
name-literal. For more information on DEFINE names, see DEFINEs.
If the file-system file name identified by define-name-literal is qualified
(the subvolume and any other qualifiers are specified), then that specific file is
the COPY library. If the file-system file name identified is not qualified, the file
selected as the COPY library depends on the presence or absence of a
DEFINE of class SEARCH named =_SOURCE_SEARCH. If
=_SOURCE_SEARCH exists, the search list that it specifies is used to locate
the COPY library. If =_SOURCE_SEARCH does not exist, only the current
volume and subvolume is searched for the COPY library.
REPLACING phrase
specifies text-words for the compiler to replace with other specified text-words
when it copies text. See REPLACING Phrase.