IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Refer the current generation in a subsequent step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Sat Feb 21, 2009 5:39 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 21, 2009 5:51 pm
Reply with quote

(+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
View user's profile Send private message
Debabrata Pruseth

New User


Joined: 11 Dec 2008
Posts: 59
Location: Pune , India

PostPosted: Sun Feb 22, 2009 1:48 am
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sun Feb 22, 2009 4:06 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top