View previous topic :: View next topic
|
Author |
Message |
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi All,
I have a GDG with 200 versions. There is a requirement in my project to delete the first 199 versions and to retain only the latest version. Kindly let me know the command to delete all the versions and to retain only the latest version alone.
Thanks in advance! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Generations not versions. . .
There is no such command. . .
You could copy the one generation you want to keep to some other dataset name, delete all of the cataloged generations (that can be done with one dd statement), then copy the saved generation back to the proper dataset name.
I've never tried to rename a dataset into a gdg, so i'd use copy . . . |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi Dick,
Can you pls let me know how delete all the cataloged generations with one dd statement.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You could use
Code: |
//DD1 DD DSN=the.gdg,DISP=(OLD,DELETE) |
Make sure you have copied the one you want to keep first. . . |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi Dick,
Just one more doubt,,
Should I mention the base name in the DSN parameter or any generation? |
|
Back to top |
|
|
abhishek dadhichi
New User
Joined: 19 Apr 2007 Posts: 37 Location: Bangalore
|
|
|
|
Hi nithivenkat,
Yes..according to the code given by Dick..the DSN parameter should have the GDG base name ,that's what is specified in his code 'the.gdg'.
Thanks,
Abhishek |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Dick,
if any are migrated, they will be recalled, it might be best to use IDCAMS,
or alternatively change the limit to 1, this will roll off and delete all except the lastest GDG.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Gerry,
Quote: |
it might be best to use IDCAMS |
Yup, might be. I was remembering a situation where we creasted a flock of +1's during the day, processed them all in a batch job and deleted the lot as they were all still online. . .
If these are older and migrated, the recall could be a pain. . . |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi gcicchet,
Pls let me know how to set the limit to 1 using IDCAMS.
Thanks. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is an example
Code: |
//STEP0001 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER gdgname LIMIT(01)
/*
|
You may want to set it back to the original limit after this.
Gerry |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Thank you Dick and gcicchet |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I wonder what about the data in those 199 generations once limit is set to 1? |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Those 199 generations would be recataloged or uncataloged or deleted... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi Gnanas,
Gnanas N wrote: |
Those 199 generations would be recataloged or uncataloged or deleted... |
'am sorry, didn't get you - was it for me? |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Yes, Anuj! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Anuj D. wrote: |
I wonder what about the data in those 199 generations once limit is set to 1? |
Try it and see |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Well, my concern was - were those GDGs never needed? is it a production scenario? why did not they had a simple QSAM DSN instead of choosing GDGs at first place then? What benefit would they get "rolling" the GDGs on a later date..?
Tried, only "latest" was left others were "lost" and their data as well.. |
|
Back to top |
|
|
|