COPY Statement

The COPY statement is a library statement that places prewritten text in a COBOL program.

The COPY statement has three formats:
IBM Extension
IBM Extension End of IBM Extension
End of IBM Extension

Prewritten source program entries can be included in a source program at compilation time. Thus, an installation can use standard file descriptions, record descriptions, or procedures without recoding them. These entries and procedures can then be saved in user-created libraries; they can then be included in the source program by means of the COPY statement.

Compilation of the source program containing COPY statements is logically equivalent to processing all COPY statements before processing the resulting source program.

The effect of processing a COPY statement is that the library text associated with text-name is copied into the source program, logically replacing the entire COPY statement, beginning with the word COPY and ending with the period, inclusive. When the REPLACING phrase is not specified, the library text is copied unchanged.

Related Information: