z/OS MVS JCL Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Examples of procedures

z/OS MVS JCL Reference
SA23-1385-00

Example 1
In the input stream:

//JOBA        JOB  ACCT23,'G. HILL'
//STEPA       EXEC PROC=REP
//PSTEP1.INDS DD   *
              .
              (data)
              .
/*

In SYS1.PROCLIB member REP:

//       PROC
//PSTEP1 EXEC PGM=WRIT22
//OUTDS  DD   SYSOUT=A

In this example, the EXEC statement STEPA calls the cataloged procedure named REP and supplies in-stream data. The procedure executes a program named WRIT22. The output from the program will appear in the sysout class A data set.

Example 2
In the input stream:

//JOB1         JOB     ,'H.H. MORRILL'
//ADD1         OUTPUT  COPIES=2
//STEPA        EXEC    PROC=P
//PS1.OUTA     OUTPUT  CONTROL=DOUBLE,COPIES=5
//PS1.DSB      DD      OUTPUT=*.ADD1
//PS1.DSE      DD      *
               .
               (data)
               .
/*
//PS2.OUTB     OUTPUT  DEFAULT=YES,DEST=STL

In SYS1.PROCLIB member P:

//PS1         EXEC    PGM=R15
//OUTA        OUTPUT  CONTROL=PROGRAM
//DSA         DD      SYSOUT=C,OUTPUT=*.OUTA
//DSB         DD      SYSOUT=D,OUTPUT=*.OUTA
//PS2         EXEC    PGM=T48
//DSC         DD      SYSOUT=A
In this example, added statements are:
  • ADD1, which is an OUTPUT JCL statement added at the job level.
  • PS1.DSE, which is an in-stream data set added to procedure step PS1.
  • PS2.OUTB, which is a default OUTPUT JCL statement added to procedure step PS2.
Overriding statements are:
  • PS1.OUTA, which changes the CONTROL parameter and adds a COPIES parameter to OUTPUT statement OUTA in procedure step PS1.
  • PS1.DSB, which changes the OUTPUT parameter on DD statement DSB in procedure step PS1.
Example 3
//JOBB        JOB  ACCT23,'G. HILL'
//STEPB       EXEC PROC=WRIT35,COND.PSTEP3=(4,GT,PSTEP1),RD=R
//PSTEP1.DD1  DD   VOLUME=SER=,UNIT=SYSDA,DISP=(NEW,CATLG)
//PSTEP1.INDS DD   *
              .
              .
              (data)
              .
/*
//PSTEP2.DD3  DD   DISP=(OLD,KEEP)
//PSTEP3.DD5  DD   DUMMY
//PSTEP3.DD6  DD   DSNAME=A.B.C
//PSTEP3.DD8  DD   EXPDT=


In SYS1.PROCLIB member WRIT35:

//       PROC
//PSTEP1 EXEC PGM=WT1,TIME=(,50)
//DD1    DD   DSNAME=DATA1,DISP=(NEW,DELETE),SPACE=(TRK,(10,2)),
//        UNIT=3390,VOL=SER=1095
//DD2    DD   DSNAME=&&WORK,UNIT=SYSDA,SPACE=(CYL,(10,1)),
//        DISP=(,PASS)
//PSTEP2 EXEC PGM=WT2,TIME=(,30)
//DD3    DD   DSNAME=*.PSTEP1.DD2,DISP=(OLD,DELETE)
//PSTEP3 EXEC PGM=UPDT,TIME=(,45),RD=RNC
//DD4    DD   SYSOUT=*
//DD5    DD   DSNAME=DATA3,UNIT=3390,DISP=OLD,
//        VOLUME=SER=335006
//DD6    DD   DSNAME=QOUT,UNIT=3390
//DD7    DD   SYSOUT=H
//DD8    DD   DSNAME=A.B,DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(1)),EXPDT=92365,UNIT=SYSDA

In this example, EXEC statement STEPB calls the cataloged procedure WRIT35. The COND parameter is added to the EXEC statement for PSTEP3. The RD parameter is added to the EXEC statements for PSTEP1 and PSTEP2, and overrides the RD parameter on the EXEC statement for PSTEP3.

In-stream DD statement PSTEP1.DD1 modifies DD statement DD1 in PSTEP1; it nullifies the VOLUME=SER parameter and overrides the UNIT and DISP parameters. Note that the parameters are not in the same order in the overriding and overridden statements.

In-stream DD statement PSTEP1.INDS is added to PSTEP1, supplying in-stream data to be read by program WT1.

In-stream DD statement PSTEP2.DD3 modifies DD statement DD3 in PSTEP2; it overrides the DISP parameter. Note that the entire parameter is coded, even though only the second subparameter is being changed.

In-stream DD statement PSTEP3.DD5 nullifies DD statement DD5 in PSTEP3. However, DD statement DD5 will be checked for correct syntax.

In-stream DD statement PSTEP3.DD6 modifies DD statement DD6 in PSTEP3; it overrides the DSNAME parameter.

In-stream DD statement PSTEP3.DD8 modifies DD statement DD8 in PSTEP3; it nullifies the EXPDT parameter. Note that the EXPDT keyword cannot have a null value. Therefore, you cannot nullify EXPDT by setting it to a substitution text in the procedure DD and then nullifying the symbol on the invoking EXEC statement. EXPDT can only be nullified by not coding a value for it on the overriding DD statement.

Note that procedure DD statements DD2, DD4, and DD7 were not modified.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014