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


Examples of defining and coding symbols in JCL

z/OS MVS JCL Reference
SA23-1385-00

Example 1:
//JOBA     JOB  ...
//INSTREAM PROC LOC=POK
//PSTEP    EXEC PGM=WRITER
//DSA      DD   SYSOUT=A,DEST=&LOC
//         PEND
//CALLER   EXEC PROC=INSTREAM,LOC=NYC
//

In this example of an in-stream procedure, the &LOC symbol has a default value of POK on the PROC statement; then it is assigned an execution value of NYC on the calling EXEC statement.

Example 2:
//JOBB      JOB  ...
//INSTREAM  PROC LOC=POK,NUMBER=3390
//PSTEP     EXEC ...
//PIN       DD   DSNAME=REPORT,DISP=(OLD,KEEP),UNIT=&NUMBER
//POUT      DD   SYSOUT=A,DEST=&LOC
//          PEND
//CALLER    EXEC PROC=INSTREAM,NUMBER=,LOC=STL
//PSTEP.INDATA  DD   *
               .
               (data)
               .
/*

This code nullifies the &NUMBER JCL symbol. The calling EXEC statement assignment of STL for the &LOC symbol overrides the PROC statement assignment of POK.

Example 3: This example illustrates execution of an in-stream procedure to test symbols before placing the procedure in a procedure library. The in-stream procedure named TESTPROC is:
//TESTPROC PROC A=IMB406,B=ABLE,C=3390,D=WXYZ1,
//           E=OLD,F=TRK,G='10,10,1'
//STEP     EXEC PGM=&A
//DD1      DD   DSNAME=&B,UNIT=&C,VOLUME=SER=&D,DISP=&E,
//           SPACE=(&F,(&G))
//         PEND
To execute this in-stream procedure and override &A with IEFBR14, &B with BAKER, and &E with (NEW, KEEP) but leave the other parameters the same, call the in-stream procedure with:
//CALLER1 EXEC PROC=TESTPROC,A=IEFBR14,B=BAKER,E=(NEW,KEEP)

Note that the value (NEW,KEEP) does not require apostrophes because it contains a matched pair of parentheses. See Table 3 for more information.

After symbolic substitution, the statements are:
//STEP  EXEC PGM=IEFBR14
//DD1   DD   DSNAME=BAKER,UNIT=3390,VOLUME=SER=WXYZ1,
//          DISP=(NEW,KEEP),SPACE=(TRK,(10,10,1))
Example 4: To execute the in-stream procedure in the previous example and change DD1 to resemble a temporary scratch space, code the following statement:
//CALLER2 EXEC PROC=TESTPROC,A=IEFBR14,B=,C=3390,D=,E=
After symbolic substitution, the statements are:
//STEP  EXEC PGM=IEFBR14
//DD1   DD DSNAME=,UNIT=3390,VOLUME=SER=,DISP=,SPACE=(TRK,(10,10,1))

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014