In-stream procedures

An in-stream procedure is a named set of job control statements in a job that can be re-executed within that job, simply by invoking the name of the procedure. This enables you to execute the set of control statements more than one time in the same job without having to repeat the statements.

Table 1 shows a job that contains an in-stream procedure. Its name is PTEST, and it ends with a PEND statement.

Table 1. In-stream procedure
Job control statement Explanation
//JOB1 JOB CT1492,'JIM MOSER' Starts job
//PTEST PROC Starts in-stream procedure
//PSTA EXEC PGM=CALC Identifies first step in procedure
//DDA   DD    DSNAME=D.E.F,DISP=OLD
//DDB   DD    DSNAME=DATA1,DISP=(MOD,PASS)
//DDOUT DD    SYSOUT=*
Request 3 data sets for first procedure step
//PSTB EXEC PGM=PRNT Identifies second step in procedure
//DDC   DD    DSNAME=*.PSTA.DDB,DISP=OLD
//DDREP DD    SYSOUT=A
Request 2 data sets for second procedure step
// PEND Ends in-stream procedure
//STEP1 EXEC PROC=PTEST First step in JOB1, executes procedure
//PSTA.IN DD  *
        .
        (data)
        .
/*

Adds in-stream data to procedure step
PSTA

Note: The maximum number of in-stream procedures you can code in any job is 15.