Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-32
COPY Statement
SECTION line is recognized or end-of-file is reached. In the following example, text-0
has no SECTION command and could never be copied:
text-0
?SECTION copy-text-1
text-1
When a library file begins like this, this text could be comments about the library
contents.
In the following example, notice that employee-detail of the COPY statement is not
qualified because the copy library, named COPYLIB, resides on the default volume
and subvolume for the compilation.
The contents of the copy library COPYLIB are as follows:
?SECTION employee-detail
01 emp-data-in.
05 emp-no PIC X(05).
05 emp-name PIC X(20).
05 dept PIC X(03).
05 job-class PIC X(05).
05 hourly-rate PIC 9(3)V99.
05 deductions PIC 9(3)V99.
05 salary PIC 9(7)V99.
The SCREEN COBOL source code is as follows:
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY employee-detail.
In the compile listing in the example below, all lines from a copy library are marked with
a <.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY employee-detail.
< 01 emp-data-in.
< 05 emp-no PIC X(05).
< 05 emp-name PIC X(20).
< 05 dept PIC X(03).
< 05 job-class PIC X(05).
< 05 hourly-rate PIC 9(3)V99.
< 05 deductions PIC 9(3)V99.
< 05 salary PIC 9(7)V99.