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
 

 

Print the last GDG name created.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Print the last GDG name created.
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

Moderator Team Head


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

PostPosted: Fri Apr 18, 2008 4:27 pm    Post subject: Reply to: Print the last GDG name created.
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: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 18, 2008 5:01 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Print the last GDG name created.
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    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 print out the correct info in LOOP? jackzhang75 CLIST & REXX 7 Wed Dec 23, 2015 10:39 pm
No new posts Include a member getting created with... anjali.bisht JCL & VSAM 5 Tue Oct 13, 2015 11:19 am
No new posts How to print a variable in SAS progra... LOKESH DAIVAM All Other Mainframe Topics 6 Thu Aug 13, 2015 12:24 pm
No new posts Not able to PuT message in Newly crea... avinash sengar Java & MQSeries 1 Fri Nov 28, 2014 5:33 pm
No new posts EZACFSM1 created file name - passing ... MSecorsky JCL & VSAM 23 Tue Sep 30, 2014 9:33 pm


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