JCL Catalog Procedure

JCL Instream Procedure

Advertisements


Procedure included from another place called as catalog procedure.

A procedure that cataloged in a library is called a cataloged procedure.

It may be a personal library or system library.

The library is of type PDS/PDSE.

The name of the catalog procedure is a member name or alias name in the library.

Procedure always defined outside of the JCL in catalog procedure.

PEND is not mandatory in catalog procedure.

Catalog procedure allows CNTL, command, DD, ENDCNTL, EXEC, IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET statements only.

The system procedure library is SYS1.PROCLIB and may change the library name based on the installation.

Maximum 255 procedures can be defined in the single job.

PROCLIB is mandatory to provide the library to the JCL where the catalog procedures are placed.

Catalog procedure can be coded within the Catalog procedure.

To call Catalog procedure, the name of the procedure should be coded at EXEC PROC.

Catalog procedure is not verified for syntax errors until an EXEC statement that calls the procedure.

When a cataloged procedure is called, the calling step receives a copy of the procedure


Syntax:

//[name]  PROC [parameter  [comments]]
//[name]  PROC

Defaults and Overrides:


To override a default parameter value on a PROC statement, code the same parameter on the EXEC statement that calls the procedure.

If not coded, the default values coded in PROC statement will get applied.


Example 1:

//STEP01   EXEC PGM=PROG1
//STEPPRC  EXEC PROC=MTHPROC

MTHPROC:

//MTHPROC
//STEP02   EXEC PGM=PROG2
//STEP03   EXEC PGM=PROG3

The above example showing the catalog procedure definition and execution within the same job.


Example 2:

//STEP01   EXEC PGM=PROG1
//STEPPRC  EXEC PROC=MTHPROC,TIME=(9,30)

MTHPROC:

//MTHPROC
//STEP02   EXEC PGM=PROG2
//STEP03   EXEC PGM=PROG3

In the above example, the TIME statement adds the time to all the steps of the catalog procedure. All the steps in the catalog procedure can use the processor for 9 minutes and 30 seconds.


Example 3:

//STEP01   EXEC PGM=PROG1
//STEPPRC  EXEC PROC=MTHPROC,TIME=(9,30)

MTHPROC:

//MTHPROC
//STEP02   EXEC PGM=PROG2
//STEP03   EXEC PGM=PROG3

In the above example, the TIME statement overrides the TIME values of all the steps in catalog procedure. All the steps in the catalog procedure can use the processor for 9 minutes and 30 seconds.


Example 4:

//STEP01   EXEC PGM=PROG1
//STEPPRC  EXEC PROC=MTHPROC,TIME=

MTHPROC:

//MTHPROC
//STEP02   EXEC PGM=PROG2
//STEP03   EXEC PGM=PROG3

In the above example, the TIME statement nullifies the TIME values of all the steps in the catalog procedure. TIME parameter values in procedure can be ignored and TIME parameter default value 1440 applied to the entire job.


JCL Instream Procedure

Advertisements