Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Eliminating repetitive coding

Use the COPY statement in any program division and at any code sequence level to include stored source statements in a program. You can nest COPY statements to any depth.

To specify more than one copy library, either set the environment variable SYSLIB to multiple path names separated by a semicolon (;) or define your own environment variables and include the following phrase in the COPY statement:

IN/OF library-name

For example:

COPY MEMBER1 OF COPYLIB

If you omit this qualifying phrase, the default is SYSLIB.

Use a command such as the following example to set an environment variable that defines COPYLIB at compile time:

SET COPYLIB=D:\CPYFILES\COBCOPY

COPY and debugging line: In order for the text copied to be treated as debug lines, for example, as if there were a D inserted in column 7, put the D on the first line of the COPY statement. A COPY statement itself cannot be a debugging line; if it contains a D and WITH DEBUGGING mode is not specified, the COPY statement is nevertheless processed.

Example: using the COPY statement

related references
Compiler-directing statements


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)