JOBLIB Example


Scenario1 - JOBLIB with one library.

Code -

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

Explaining Example -

The system searches for the programs PROG1 and PROG2 in MTH.JLOADLIB.

Scenario2 - JOBLIB with multiple libraries.

Code -

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

Explaining Example -

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

Scenario3 -

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.