COPYLIB
COPYLIB
COPYLIB is a DD statement used to code the copybook PDS in the compilation step (IGYCRCTL step) of the JCL at the compilation time. COPYLIB is a private library (PDS), and each member contains the copybook layout that is used by many application programs.
The system searches the copybooks in the COPYLIB PDS while compiling the program if they coded. Otherwise, it searches in the system COPY library.
Syntax -
//COPYLIB DD DSN=library-name,DISP=SHR
Where -
- library-name is the PDS where the copybook resides.
A COPY statement is used to copy the copybook from the library to the program.
Examples -
Scenario - Coding a single COPY library.
//COB EXEC PGM=IGYCRCTL,REGION=4M,COND=((4,LT,PC),(4,LT,TRN)),
// PARM='NODYNAM,LIB,OBJECT,RES,APOST,MAP,XREF,NOSEQUENCE'
//STEPLIB DD DSN=IGY420.SIGYCOMP,DISP=SHR
//SYSLIB DD DSN=MTH.TEST.COPYLIB,DISP=SHR
...
The system searches the libraries for copy libraries in the following order -
- MTH.TEST.COPYLIB
- MTH.AIT.COPYLIB
- MTH.PROD.COPYLIB