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]

Examples -


Scenario1 - 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 the libraries for procedure MTHPROC in the following order -

  1. MTH.PROCLIB
  2. SYS1.PROCLIB

Scenario2 - Coding MTH.PROCLIB, MTH.PROCLIB1 and MTH.PROCLIB2 as proc library.

//MTHEXMP1 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID
//PROCLIB DD DSN=MTH.PROCLIB,DISP=SHR
//        DD DSN=MTH.PROCLIB1,DISP=SHR
//        DD DSN=MTH.PROCLIB2,DISP=SHR
//STEP01 EXEC MTHPROC

The system searches the libraries for procedure MTHPROC in the following order -

  1. MTH.PROCLIB
  2. MTH.PROCLIB1
  3. MTH.PROCLIB2
  4. SYS1.PROCLIB