Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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 -> SMS & VSAM
Author Message
bhagyac

New User


Joined: 17 Apr 2008
Posts: 6
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
References
PostPosted: Fri Apr 18, 2008 3:23 pm    Post subject: Re: Print the last GDG name created. Reply with quote

Moved: Fri Apr 18, 2008 4:24 pm by superk From JCL to SMS & VSAM
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3014
Location: Charlotte,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: 2551
Location: Brussels once more ...

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: 6
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

Active User


Joined: 14 Jul 2006
Posts: 65
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM All times are GMT + 6 Hours
Page 1 of 1