STEPLIB
The STEPLIB is used to specify one or more user-defined libraries at the step level where the load module resides. When the job is submitted for execution, the system will search these libraries to find the load module running at the step.
When a program runs at the job step, the system searches for the required load module first in the STEPLIB libraries, and if it is not found, then it searches in the system libraries. If STEPLIB is not coded, the system searches in system libraries.
A job can have multiple STEPLIB statements. However, a job step can have only one STEPLIB statement. A STEPLIB is optional.
Syntax -
//STEPLIB DD DSN=library-name,DISP=SHR [comments]
Where:
- library-name is the PDS where the program load modules resides.
Notes -
- If the system can't find the program in the coded library, it starts checking in system libraries.
- A maximum of 255 STEPLIBs can be coded in the JOB.
- If a STEPLIB DD is coded in a job that also has a JOBLIB, the STEPLIB takes precedence when searching for a program for the particular step.
- If more than one library is coded in STEPLIB, the order of searching for the load by the system is the same as how they are coded in STEPLIB.
Examples -
Scenario - STEPLIB with one library.
//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
The system searches MTH.LOADLIB1 for the program PROG1 and MTH.LOADLIB2 for PROG2.