JOBLIB DD Statement

Purpose

The JOBLIB DD statement defines a private library that the system will search for programs before searching the system libraries. It applies to all job steps and extends the program search path for the entire job.

Syntax

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

Key Components

  • JOBLIB - The fixed ddname that identifies this as a JOBLIB 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 JOBLIB Statement

jcl
1
2
3
//MYJOB JOB (ACCT123),'JOHN SMITH' //JOBLIB DD DSN=USER.LOADLIB,DISP=SHR //STEP1 EXEC PGM=MYPROG

Concatenated JOBLIB Libraries

jcl
1
2
3
4
5
6
//MYJOB JOB (ACCT123),'JOHN SMITH' //JOBLIB DD DSN=USER.LOADLIB,DISP=SHR // DD DSN=DEPT.LOADLIB,DISP=SHR // DD DSN=PROJECT.LOADLIB,DISP=SHR //STEP1 EXEC PGM=MYPROG1 //STEP2 EXEC PGM=MYPROG2

JOBLIB with STEPLIB

jcl
1
2
3
4
5
6
7
8
9
//MYJOB JOB (ACCT123),'JOHN SMITH' //JOBLIB DD DSN=USER.LOADLIB,DISP=SHR //* //STEP1 EXEC PGM=MYPROG1 //* //STEP2 EXEC PGM=MYPROG2 //STEPLIB DD DSN=SPECIAL.LOADLIB,DISP=SHR //* Note: STEPLIB overrides JOBLIB for this step only //STEP3 EXEC PGM=MYPROG3

Notes

  • The JOBLIB DD statement must appear after the JOB statement and before the first EXEC statement
  • It applies to all steps in the job unless overridden by a STEPLIB DD statement
  • Libraries are searched in the order they are concatenated
  • If a program is found in a JOBLIB library, the system libraries are not searched
  • JOBLIB is ignored for steps that execute cataloged procedures
  • 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 JOBLIB DD statement

Related Concepts

Related Pages