Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 5: JCL PROCs Statement


Cataloged Procedure

A set of JCL statements that are grouped together, given a name, and then recorded as a member of partitioned dataset. These procedures are cataloged and placed inside a system or user-defined library. IBM supplies a utility program called IEBUPDTE; This utility stores catalogued procedures into PDS. Traditionally, these procedures were stored inside a system library ‘SYS1.PROCLIB’.

Following is an example of catalogued procedure:-

//CATALOGE PROC //STEP1 EXEC PGM=PROG1 //DATA1 DD DSN=DEPT1.EMP1.DATA1, // DISP=SHR //STEP2 EXEC PGM=PROG2 //DATA1 DD DSN=DEPT1.EMP1.DATA2, // DISP=SHR

Once procedure is created and tested, it can be cataloged(placed) inside a system library or any user defined library. These library reside as partitioned data set. There is one predefined system library provided by IBM i.e. SYS1.PROCLIB, the procedure can be stored inside this library or can be stored as member of user-defined library. We will be storing above coded procedure inside a user defined library called ‘USER.DEPT.PROCLIB’. As stated above, IBM provided utility called IEBUPDTE is used to cataloge this procedure and add it to above mentioned library.

Once procedure is cataloged, it can be called and executed as follows:-

//DEPTJOB JOB A123,’STEVE’ //PROCLIB JCLLIB ORDER=(USER.DEPT.PROCLIB,USER.DEPT.PROCLIB2) //STEP100 EXEC CATALOGE

The JCLLIB statement coded above defines the user specified order of location of the cataloged procedure. In our case order is (USER.DEPT.PROCLIB,USER.DEPT.PROCLIB2). And finally EXEC statement is used to call and execute cataloged procedure "CATALOGE"

Rules for coding Cataloged procedure:

Along with rules explained above in "JCL Procedure" section, below are few more rules applicable while coding Cataloged procedure

  • The procedure name must be unique within the procedure library that it is stored in.
  • PEND statement is not required



Advertisements






© copyright mainframebug.com
Privacy Policy