Tuesday, 9 April 2019

How to create and use cataloged procedures.

In-stream procedure
JCL Catalog Procedure's
A JCL cataloged procedure (or just procedure) is a pre-written segment of code consisting of one or more job steps that you can include in a job stream. 

By using procedures/JCL catalog procedure, the amount of JCL coding you have to do is reduced, resulting in fewer coding errors and greater productivity.

Definition of cataloged procedure. 

A cataloged procedure is a series of JCL statements that are stored in a partitioned data set and may be invoked by any job on the system.

Typical types of cataloged procedures

  • IBM-supplied procedures that compile, link, and run programs
  • JCL steps that back up, delete and define VSAM files
  • Programs that are required by many jobs
  • Large jobs where it makes sense to separate the steps into manageable procedures.
Important Points:
Cataloged procedures are stored in partitioned data sets and can be invoked by any job on the system. When you invoke a cataloged procedure, the system looks for it in the system procedure library, SYS1.PROCLIB, unless you specify otherwise.

The syntax for invoking a JCL procedure


EXEC [PROC=]procedure-name

Explanation

procedure-name Identifies the procedure to be called and executed. For cataloged procedures, it’s the member name of the procedure. For in-stream procedures, it’s the name on the PROC statement that begins the procedure.

Example:

A job that invokes a cataloged procedure


//RC01RN JOB (45512),'R ROGGER',NOTIFY=RC01
//STEP1 EXEC TMP3000
//


The cataloged JCL procedure named TMP3000 that is invoked


//TMP3000  PROC 
//TMP3010 EXEC PGM=EMP33010
//SYSOUT  DD SYSOUT=*
//INVMAST DD DSNAME=RCA2.INVE.MASTER.FILE,DISP=SHR
//INVSEL  DD DSNAME=&&INVSEL,DISP=(NEW,PASS),
//           UNIT=SYSDA,SPACE=(CYL,(20,10))
//SELCTL  DD DUMMY
//INV3020 EXEC PGM=EMP3020
//SYSOUT  DD SYSOUT=*
//INVMAST DD DSNAME=&&INVSEL,DISP=(OLD,DELETE)
//INVSLST DD SYSOUT=*


JCL


No comments:

Post a Comment

New In-feed ads