STEPLIB DD Statement

Purpose

The STEPLIB DD statement defines a private library that the system will search for programs before searching the system libraries. Unlike JOBLIB, it applies only to the specific job step where it appears, providing step-level control of the program search path.

Syntax

jcl
1
2
3
//STEPLIB DD DSN=library-name,DISP=SHR // DD DSN=library-name,DISP=SHR // ...

Key Components

  • STEPLIB - The fixed ddname that identifies this as a STEPLIB DD statement.
  • DSN=library-name - Specifies the name of the library to be searched.
  • DISP=SHR - Indicates that the library will be shared (this is required).

Examples

Basic STEPLIB Statement

jcl
1
2
//STEP1 EXEC PGM=MYPROG //STEPLIB DD DSN=USER.LOADLIB,DISP=SHR

Concatenated STEPLIB Libraries

jcl
1
2
3
4
//STEP1 EXEC PGM=MYPROG //STEPLIB DD DSN=USER.LOADLIB,DISP=SHR // DD DSN=DEPT.LOADLIB,DISP=SHR // DD DSN=PROJECT.LOADLIB,DISP=SHR

STEPLIB Overriding JOBLIB

jcl
1
2
3
4
5
6
7
8
9
//MYJOB JOB (ACCT123),'JOHN SMITH' //JOBLIB DD DSN=GLOBAL.LOADLIB,DISP=SHR //* //STEP1 EXEC PGM=MYPROG1 /* Uses JOBLIB */ //* //STEP2 EXEC PGM=MYPROG2 //STEPLIB DD DSN=SPECIAL.LOADLIB,DISP=SHR /* Overrides JOBLIB */ //* //STEP3 EXEC PGM=MYPROG3 /* Uses JOBLIB again */

STEPLIB in a Procedure

jcl
1
2
3
4
5
6
7
//MYPROC PROC //STEP1 EXEC PGM=MYPROG //STEPLIB DD DSN=PROC.LOADLIB,DISP=SHR //PEND //CALLP EXEC MYPROC //STEP1.STEPLIB DD DSN=USER.LOADLIB,DISP=SHR /* Overrides the proc's STEPLIB */

Notes

  • The STEPLIB DD statement applies only to the step in which it appears
  • STEPLIB overrides any JOBLIB DD statement for that step
  • Libraries are searched in the order they are concatenated
  • If a program is found in a STEPLIB library, the system libraries are not searched
  • DISP must always be SHR to allow concurrent access
  • Libraries specified must be partitioned data sets (PDS or PDSE) containing load modules
  • You can concatenate up to 16 libraries in a STEPLIB DD statement
  • STEPLIB can be overridden in procedure calls using the step.ddname syntax

Related Concepts

Related Pages