A COPY statement can be used in the source program wherever a character-string or separator can be used. Each COPY statement must be preceded by a space and followed by a period and a space. For more information on the COPY statement, refer to the "COPY Statement" section of the WebSphere Development Studio: ILE COBOL Reference.
The Format 1 COPY statement can be used within the PROCESS statement to retrieve compiler options previously stored in a source library, and include them in the PROCESS statement. COPY can be used to include options that override those specified as defaults by the compiler. Any PROCESS statement options can be retrieved with the COPY statement.
Compiler options can both precede and follow the COPY statement within the PROCESS statement. The last encountered occurrence of an option overrides all preceding occurrences of that option.
The following example shows the use of the COPY statement within the PROCESS statement. Notice also that, in this example, NOMAP overrides the corresponding option in the library member:
Figure 9. Using COPY within the PROCESS Statement
5722WDS V5R3M0 030905 LN IBM ILE COBOL CBLGUIDE/COPYPROC ISERIES1 03/09/15 11:39:37 Page 2 S o u r c e STMT PL SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG DATE 000100 PROCESS XREF 000200 COPY PROCDFLT. +000100 MAP, SOURCE, APOST PROCDFLT +000200 PROCDFLT 000300 NOMAP, FLAG(20) 1 000400 IDENTIFICATION DIVISION. 2 000500 PROGRAM-ID. COPYPROC. 3 000600 ENVIRONMENT DIVISION. 4 000700 CONFIGURATION SECTION. 5 000800 SOURCE-COMPUTER. IBM-ISERIES 6 000900 OBJECT-COMPUTER. IBM-ISERIES 7 001000 PROCEDURE DIVISION. 001100 MAINLINE. 8 001200 DISPLAY "HELLO WORLD". 9 001300 STOP RUN. 001400 * * * * * E N D O F S O U R C E * * * * * |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.