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

Print the last GDG name created.


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

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Fri Apr 18, 2008 3:23 pm
Reply with quote

Hi,

I want to Print the Last GDG version created. For Eg. if i have
AAA.BBB.CCC.v001
AAA.BBB.CCC.v002
AAA.BBB.CCC.v003
.
.
AAA.BBB.CCC.v0014

I want to print the latest GDG name(AAA.BBB.CCC.v0014) in the spool, indicating that, that is the last one available.

Can any one help me in this, how to get that.

Thank you.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Apr 18, 2008 4:27 pm
Reply with quote

Use IDCAMS LISTCAT to create the list of entries, and SORT to select the last entry from the list.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 18, 2008 5:01 pm
Reply with quote

Can I ask why you would want to do this ?
Back to top
View user's profile Send private message
bhagyac

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Fri Apr 18, 2008 7:13 pm
Reply with quote

Hi,
Thanks for your information. Let me try out with that.

Hi Expat,
Here is the reason why i need that...
A job takes a GDG version as input. When it fails, i want to get that GDG generation name, (for which the has failed) in the report.

Thank you.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Mon Apr 21, 2008 2:33 pm
Reply with quote

Bhagya,

Try the following jcl for your requirement and go by what Kevin has mentioned.


Code:
//*HOW TO GET THE LAST GDG VERSION
//STEP10  EXEC PGM=IDCAMS
//DD1       DD DSN=YOUR.GDG.TOTEST(+0),DISP=SHR
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 PRINT INFILE(DD1) COUNT(0) CHAR
/*
//


Syam
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 JCL sortcard to print only the records DFSORT/ICETOOL 11
No new posts is there a way to print time in HH:MM... SYNCSORT 12
No new posts Print out all lines with 'IBM' compil... CLIST & REXX 8
No new posts Back Page print direction (Duplex Pri... JCL & VSAM 3
No new posts Print report for each record from mul... CA Products 1
Search our Forums:

Back to Top