STEPLIB Example


Scenario1 - STEPLIB with one library.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//STEP01  EXEC PGM=PROG1
//STEPLIB DD   DSN=MTH.LOADLIB1,DISP=SHR
//STEP02  EXEC PGM=PROG2
//STEPLIB DD   DSN=MTH.LOADLIB2,DISP=SHR

Explaining Example -

The system searches MTH.LOADLIB1 for the program PROG1 and MTH.LOADLIB2 for PROG2.

Scenario2 - STEPLIB with multiple libraries

Code -

----+----1----+----2----+----3----+----4----+----5----+
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//STEP2   EXEC PGM=PROG1
//STEPLIB DD   DSN=MTH.LOADLIB1,DISP=SHR
//        DD   DSN=MTH.LOADLIB2,DISP=SHR

Explaining Example -

The system searches MTH.LOADLIB1 and MTH.LOADLIB2 for the program PROG1.

Scenario3 - STEPLIB and JOBLIB.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//JOBLIB  DD   DSN=MTH.JLOADLIB,DISP=SHR
//STEP01  EXEC PGM=PROG1
//STEPLIB DD   DSN=MTH.LOADLIB,DISP=SHR
//STEP2   EXEC PGM=PROG2

Explaining Example -

The system searches MTH.LOADLIB and MTH.JLOADLIB for the program PROG1. The system searches MTH.JLOADLIB for PROG2 as no STEPLIB is coded in STEP2.