COPYLIB Example


Scenario1 - Coding a single COPY library.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//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
...

Explaining Example -

The system searches the libraries for copy libraries in the following order -

  1. MTH.TEST.COPYLIB
  2. MTH.AIT.COPYLIB
  3. MTH.PROD.COPYLIB

Scenario2 - Coding multiple libraries.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//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
//         DD DSN=MTH.AIT.COPYLIB,DISP=SHR
//         DD DSN=MTH.PROD.COPYLIB,DISP=SHR
//         DD DSN=DFH420.CICS.SDFHCOB,DISP=SHR
...

Explaining Example -

The system considers MTH.TEST.COPYLIB is the first priority for searching copybooks. If the desired copybook is found in it, the system won't look in other libraries. If the copybook is not found in the first library, then the system considers searching in libraries in the below order -

  1. MTH.TEST.COPYLIB
  2. MTH.AIT.COPYLIB
  3. MTH.PROD.COPYLIB