System defined DD Statements


System-defined DD statements are pre-defined DD statements used by the system to process the job. These DD statements are pre-defined by the operating system or the job control system. They are used to specify system resources and program libraries required to execute the job.

There are several system-defined DD statements in JCL, including -

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.
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]
library-name specifies the library name that contains the load module.
Example - 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
JOBLIB The JOBLIB is used to specify one or more user-defined libraries at the job 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 each step.
A job can have only one JOBLIB statement. A JOBLIB is optional.
Syntax - //JOBLIB DD DSN=library-name,DISP=SHR [comments]
library-name - is the PDS where the program load modules resides.
Example - JOBLIB with one library.
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//JOBLIB  DD   DSN=MTH.JLOADLIB,DISP=SHR
//STEP1   EXEC PGM=PROG1
//STEP2   EXEC PGM=PROG2
JCLLIB A JCLLIB statement is used to identify the private libraries used in the job. The libraries contain the cataloged procedures. The system searches the libraries in the same order coded on the JCLLIB statement. There can be only one JCLLIB statement in a JCL.
Syntax - //[DDname] JCLLIB ORDER=(library1[,library2,...]) [comments]
  • library1,library2,.. - specifies the procedure libraries. Maximum 15 datasets can be coded.
Example - Coding single procedure library.
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//MYLIBS   JCLLIB  ORDER=MTH.PROCLIB
//STEP01   EXEC PROC=MTHPROC
The system searches for procedure MTHPROC in the following order -
  • MTH.PROCLIB
  • SYS1.PROCLIB - System library.
PROCLIB PROCLIB is a system-level or user-defined library where commonly used procedures are stored. It is a collection of reusable procedures, also known as cataloged procedures, that can be called by multiple jobs. PROCLIB should code before the first EXEC statement in the job.
Syntax - //PROCLIB DD DSN=proclib-name... [comments]
Example - Coding MTH.PROCLIB as proc library.
//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//PROCLIB DD DSN=MTH.PROCLIB,DISP=SHR
//STEP01 EXEC MTHPROC
The system searches for procedure MTHPROC in the following order -
  • MTH.PROCLIB
  • SYS1.PROCLIB - System library.
COPYLIB COPYLIB is a DD statement used to specify the copybook library in the compilation step of the JCL. COPYLIB is a private library (PDS), and each member contains the copybook layout that is used by many application programs.
The system searches the copybooks in the COPYLIB library while compiling the program.
Syntax - //COPYLIB DD DSN=library-name,DISP=SHR
  • library-name is the PDS where the copybook resides.
Example - Coding a single COPY library.
//COB  EXEC PGM=IGYCRCTL,REGION=4M,
//          PARM='NODYNAM,LIB,OBJECT,RES,APOST,MAP,XREF' 
//STEPLIB  DD DSN=IGY420.SIGYCOMP,DISP=SHR 
//SYSLIB   DD DSN=MTH.TEST.COPYLIB,DISP=SHR 
...
The system searches the libraries for copy libraries in the following order -
  1. MTH.TEST.COPYLIB
  2. MTH.AIT.COPYLIB
  3. MTH.PROD.COPYLIB