Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-31
COPY Statement
library-name
is the file containing the text to be copied. The name is expanded to a full file
name using the default subvolume in effect for the compilation. If you specify the
library name with a subvolume and a file name, you must enclose the entry in
quotation marks. For example:
"subvol.afile".
If
library-name
is omitted and
copy-text
exists, the default library name
COPYLIB is used for the compilation.
Even though the COPY statement is described as a Procedure Division statement, the
statement can be included in a SCREEN COBOL program wherever a character string
or separator can appear; the only exception is within another COPY statement. The
keyword COPY cannot be split over two lines, but text that follows the keyword can be
continued.
Library text is copied into the source program. The SCREEN COBOL copy library
must be in the correct format, and each
copy-text
must be written in correct
SCREEN COBOL syntax.
A copy library must be an EDIT disk file in the following form:
Each SECTION line identifies the beginning of a
copy-text
; the question mark must
be in column 1. The content of the text is arbitrary and can be any length. No text line
can begin with ?SECTION.
The compiler assumes the source format (ANSI standard reference format or Tandem
standard reference format) of the library text is the same as that of the line containing
the COPY statement. When the format option is specified, the format overrides the
compiler's assumption, permitting a library text to be copied irrespective of the format
of the source program. Also, the library text itself can have compiler commands, which
are run when the text is copied. Note that after copying is complete, the compiler
always reverts to the format in effect when it encountered the COPY statement. For
information on restrictions on the use of the
HP Inspect
debugging tool when the ANSI
compiler command is set, see Section 7, Compilation.
During program compilation,
copy-text
is found by locating the SECTION command
whose
copy-text
name matches
copy-text
in the COPY statement. Text is
copied starting at the line after the SECTION line and continues until either another
?SECTION
copy-text-1
[ , { ANSI } ]
[ { TANDEM } ]
text-1
?SECTION
copy-text-2
[ , { ANSI } ]
[ { TANDEM } ]
text-2










