Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Refer the current generation in a subsequent step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Refer the current generation in a subsequent step
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: 7936
Location: Bellevue, IA

PostPosted: Sat Feb 21, 2009 5:51 pm    Post subject:
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    Post subject:
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: 1239
Location: Richfield, MN, USA

PostPosted: Sun Feb 22, 2009 4:06 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us