Bulletin Board

What’s new at MAINFRAMES 360
(Updates)...
- Re-writing of select JCL and VSAM Tutorials is under-way, orientation would be more hands-on, and practical
- New Tutorials on COBOL-VSAM programs shall be put up pretty soon
- IMS DB/DC Tutorials to start up in April, 2010

Mainframes360 Search

Loading

Quick Links

Jump to :  

Thursday, July 9, 2009

Modifying Statements in a Cataloged Procedure


References and external links :
- Drona Series, JCL Study Material : Mainframe Gurukul.com
- IBM MVS JCL Reference Guide

Q. Is it possible to override/modify the contents in a Cataloged Procedure?
Somtimes, we would like to change/modify some statements inside a cataloged/stored procedure. We can change

- EXEC Statement of the PROC
- DD Statement of the PROC

Modifying a parameter of the EXEC Statement
Suppose we have written the following cataloged procedure.

//MYPROC  PROC
//STEP01  EXEC  PGM=IEFBR14,TIME=10
//INFILE  DD    DSN=HERC04.DEMO.INPUT,DISP=SHR
//OUTFILE DD    DSN=HERC04.DEMO.OUTPUT,DISP=SHR

Now, suppose, we have written a main JCL/Batch Job as follows :

//MYJOB    JOB    A123,QUASAR
//LIB1     JCLLIB ORDER=(HERC04.DEMO.PROCLIB)
//PROCSTEP EXEC   PROC=MYPROC
//

Now, if we want to change the TIME parameter of MYPROC to 20, in the main JCL/Batch Job, we should write :

//MYJOB    JOB    A123,QUASAR
//LIB1     JCLLIB ORDER=(HERC04.DEMO.PROCLIB)
//PROCSTEP EXEC   PROC=MYPROC,TIME.STEP01=20
//  

We simply need to add .proc-stepname to the keyword parameter. Since, we want to modify TIME parameter of MYPROC’s STEP01, we can refer to it as TIME.STEP01.

Note : We cannot modify PGM parameter of the EXEC statement.

Adding a parameter to the EXEC Statement
On the same lines, we can also add parameters to the EXEC statement. Let me show you another example :

//MYPROC  PROC
//STEP01  EXEC  PGM=IEFBR14,TIME=10
//INFILE  DD    DSN=HERC04.DEMO.INPUT,DISP=SHR
//OUTFILE DD    DSN=HERC04.DEMO.OUTPUT,DISP=SHR

Suppose, in the main JCL that calls this procedure, we would like to add a REGION parameter on the EXEC statement.

//MYJOB    JOB    A123,QUASAR
//LIB1     JCLLIB ORDER=(HERC04.DEMO.PROCLIB)
//PROCSTEP EXEC   PROC=MYPROC,REGION.STEP01=256K
//  

Nullifying a parameter on the EXEC Statement
Suppose we want to nullify the TIME parameter of the Cataloged Procedure MYPROC.
In that case, we would have to add the following to our main JCL/Batch JOB.

//MYJOB    JOB    A123,QUASAR
//LIB1     JCLLIB ORDER=(HERC04.DEMO.PROCLIB)
//PROCSTEP EXEC   PROC=MYPROC,TIME.STEP01=
// 

Leave the keyword.procstepname field as blank. Don’t assign any value. So, if we keep TIME.STEP01 as blank, it nullifies the the value of the TIME parameter assigned to job-step STEP01 of the procedure MYPROC.

Adding or modifying DD Statements
We can
- Add/Modify/Nullify(delete) parameters on DD statements in the PROC.
- Add new DD Statements to the PROC.

Let us see how it is done with an example.

//MYPROC  PROC
//STEP01  EXEC  PGM=IEFBR14,TIME=10
//INFILE  DD    DSN=HERC04.DEMO.INPUT,DISP=SHR
//OUTFILE DD    DSN=HERC04.DEMO.OUTPUT,DISP=SHR

Suppose we would like to modify the INFILE and OUTFILE DD statements of the PROC. This can be done in the main JCL/Batch Job as follows.

//MYJOB    JOB    A123,QUASAR
//LIB1     JCLLIB ORDER=(HERC04.DEMO.PROCLIB)
//PROCSTEP EXEC   PROC=MYPROC
//STEP01.INFILE DD DSN=HERC04.INPUT.COB,DISP=SHR
//STEP01.INFILE DD DSN=HERC04.OUTPUT.COB,DISP=SHR  

Thus, we must mention the ddname as procstepname.ddname. If such a ddname does not exist in the PROC, it is simply added to the PROC.

Questions on this topic in JCL Questions Archive >>

Example of modifying the DD Statement in PROC

Suppose we have a Cataloged Procedure called MYPROC, stored in the default
System Library SYS1.PROCLIB. The JCL Listing for MYPROC is given below -

 


In the above case, MYPROC reads the contents of the Dataset HERC03.DEMO.MYLIB(INPUT), and prints it(to the default printer). Suppose, we would like to call MYPROC from another JCL. However, while calling MYPROC, we would like to override
the DSN parameter of SYSUT1 DD Statement. We want that MYPROC should print the contents of another dataset HERC03.DEMO.MYLIB(INPUT2) instead of
HERC03.DEMO.MYLIB(INPUT). To do this, we need to override DSN parameter of job-step PSTEP01 of the PROC MYPROC. The main JCL/Calling program would look like this :




0 comments:

Post a Comment

Related Posts with Thumbnails

Quick Links

Jump to :  

Note :

© Copyright – Quasar Chunawalla, 2010.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please mail at quasar.chunawalla@gmail.com
 
back to top