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; thus 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 of 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 DD DSN=USER.DEPT.PROCLIB, // DISP=SHR //STEP100 EXEC CATALOGE

The DD statement coded above defined the location of the cataloged procedure, which is USER.DEPT.PROCLIB in our case. The disposition parameter is set to shared mode(SHR), which indicates multiple job can access dataset at the same time. And finally EXEC statement is used to call and execute cataloged procedure CATALOGE

Rules for coding Cataloged procedure:

Along with rules explained above in 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 in.
  • PEND statement is not required






© copyright mainframebug.com
Privacy Policy