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

Read all GDG generations, execept last one


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

New User


Joined: 16 Aug 2005
Posts: 53

PostPosted: Fri Dec 12, 2014 12:52 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Fri Dec 12, 2014 1:05 am
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: 8569
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 12, 2014 4:37 am
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: 52
Location: UK

PostPosted: Fri Dec 12, 2014 12:59 pm
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: 489
Location: London

PostPosted: Fri Dec 19, 2014 7:13 pm
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: 446
Location: USA

PostPosted: Mon Dec 22, 2014 9:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to read duplicate rows from tabl... DB2 3
No new posts Read 4MB message and split into multi... COBOL Programming 9
No new posts how to read accounting information in... COBOL Programming 1
No new posts Dynamically read input files using BP... COBOL Programming 20
No new posts EIBRESP=16 and EIBRESP2=25 while doi... CICS 2
Search our Forums:

Back to Top