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
 

 

Read all GDG generations, execept last one

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 46

PostPosted: Fri Dec 12, 2014 12:52 am    Post subject: Read all GDG generations, execept last one
Reply with quote

I need to run a job (icetool) that reads all GDGs except the last one.
Since the number of generations may vary, Is there any way to specify in the JCL to keep the last dataset out ?

Or do i need list the GDG base thu REXX and build the JCL dynamically, submitting it thru internal reader ?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Dec 12, 2014 1:05 am    Post subject: Reply to: Read all GDG generations, execept last one
Reply with quote

You are going to need to do something to generate the JCL and arrange to have it submitted.

When framing questions, remember also that we don't know what you mean by "last one" even though you do.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri Dec 12, 2014 4:37 am    Post subject:
Reply with quote

Quote:
I need to run a job (icetool) that reads all GDGs except the last one.
Your post is remarkably non-specific. As worded, it appears that you want to read every GDG that is defined on your system (except one) -- potentially many hundreds or thousands of bases.

Assuming you really mean to read all generations of a single GDG, when you say "except the last one" -- do you mean the newest generation or the oldest generation? Either could legitimately be considered the "last" generation.

And, as otherwise stated, you will have to generate your JCL dynamically and submit it (via the internal reader) to the system. JCL really has no way to do what you are asking for.
Back to top
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 51
Location: Switz

PostPosted: Fri Dec 12, 2014 12:59 pm    Post subject:
Reply with quote

Shooting in the dark here, since there's so little information to go on:
Assuming, say, you have 20 generations for a particular GDG, why not reference my.gdg(-1) to my.gdg(-20) and leave out my.gdg(0) ?
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Fri Dec 19, 2014 7:13 pm    Post subject:
Reply with quote

Paul Voyner wrote:
Shooting in the dark here, since there's so little information to go on:
Assuming, say, you have 20 generations for a particular GDG, why not reference my.gdg(-1) to my.gdg(-20) and leave out my.gdg(0) ?



Seems the number of generations varies, otherwise that would work. So looks like he'll have to at least get the list first, e.g. with IDCAMS:

LISTCAT LEVEL(GDG.BASE.NAME.G%%%%V%%) NAME

and feed it into a JCL generator, or do it manually which would probably be just as quick.

Not sure if it matters if any GDS's are deferred or rolled-off status, but changing NAME to ALL reveals the status.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Mon Dec 22, 2014 9:16 pm    Post subject: Reply to: Read all GDG generations, execept last one
Reply with quote

Assuming, it is the oldest generation you want to skip And you know the number of records in that generation (and that is very highly unlikely), then you can use Sort to copy all records on GDG Base with Skiprec parameter to get desired output.
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
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Compare each GDG Generations to other... Ayyappa1 JCL & VSAM 13 Tue Jun 28, 2016 1:48 pm
No new posts To read from Zeke scheduler p.anbuselvan CLIST & REXX 5 Thu Mar 31, 2016 1:13 am
No new posts How to read a excel sheet and load it... Radhika Nambiar Java & MQSeries 10 Wed Mar 30, 2016 4:49 pm


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