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

Module 5: JCL PROCs Statement


In-Stream Procedure

A set of JCL statements that are grouped together, given a name, and included in the INput Stream of the job itself. The same in-stream procedure can be invoked more than once from within a job.

Syntax for defining In-Stream Procedure:

//jobName JOB …… //procName PROC <Group of JCL statements> //PEND //stepName EXEC procName

It will be easier to understand with help of example:-

//DEPTJOB JOB A123,’STEVE’ //INSTREAM 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 //PEND //STEP100 EXEC INSTREAM

In this example, DEPTJOB is submitted by Steve. IN-Stream Procedure is defined immediately following JOB statement and PROC keyword is used to indicate start of it. PEND is used to mark the end of procedure. In above example, we have coded two JCL steps inside procedure. STEP100 executes the procedure previously identified as INSTREAM.

Rules for coding In-Stream procedure

Along with rules explained above in Procedure section(previous article), below are few more rules applicable while coding In-stream procedure

  • In-stream procedure must begin with the PROC statement and must end with PEND statement
  • In-stream procedure must be coded immediately after the JOB statement, and before any EXEC statement defined
  • Maximum 15 In-stream procedure can be coded in a job



Advertisements






© copyright mainframebug.com
Privacy Policy