View previous topic :: View next topic
|
Author |
Message |
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
Suppose a generation of GDG gets created in a particular step of a proc. How should I refer the current generation in a subsequent step? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
(+0) always refers to the current generation. However, if you want to refer to the generation you just created, you must use (+1) to get to it throughout the job; once the job is complete the +1 generation will become the +0 generation. |
|
Back to top |
|
|
Debabrata Pruseth
New User
Joined: 11 Dec 2008 Posts: 59 Location: Pune , India
|
|
|
|
Hi Abhay
One thing more to be kept in mind while coding the PRC is to take care of the RESTART instructions in the subsequent steps.
For example , if STEP10 creates a GDG generation ( i.e +1 ) and STEP20 uses this current GDG generation ( i.e +1) then while executing the program if the STEP20 abends and you go for restaring STEP20 then the GDG generation being picked up in the new run will depend on the type of scheduler .
Some scheduler remember the last GDG used in the STEP and hence will use the one last referred in the abended step ( in this case same as the one created in STEP10 ) , however other will try to read +1 generation of the base which will not be there and will cause the job to abend.
So you need to check with the RESTART instruction carefully depending on the scheduler being used. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
As Debarata mentioned, schedulers will usually handle correctly the generations needed when restarting. If you restart without the aid of a scheduler, one common method is to assign symbolic variables to the generations, e.g., GEN1='(+1)', GEN2='(+2)', GEN3='(+3)', etc. When restarting you can change the gens referenced in your JCL by simply changing GEN1 to '(0)', GEN2 to '(+1)', GEN3 to '(+2)', etc. without changing the body of the JCL. You won't always be subtracting just 1 from the initial number, but you should get the drift. Each gen will be decremented by the same amount in this fashion. |
|
Back to top |
|
|
|