Delete all the generations in GDG.

JES2/3, JCL, utilities.
Post Reply
Sanjana Kashyap
New Member
Posts: 5
Joined: Wed Jul 30, 2014 10:26 am

Delete all the generations in GDG.

Post by Sanjana Kashyap »

Hi,

I've a GDG base having 5 generations, is there any way to delete all of them in a single go using some utility in JCL? Please advise.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Delete all the generations in GDG.

Post by Robert Sample »

IDCAMS
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Delete all the generations in GDG.

Post by Anuj Dhawan »

Robert - I might be wrong as there is some ambiguity in the post from OP, however I think he wants to delete the generations and want to retain the base, possibly?
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Delete all the generations in GDG.

Post by Robert Sample »

IDCAMS can delete all generations of a GDG and leave the base alone. In fact, my usual JCL to get rid of a GDG does two DELETE commands -- the first gets rid of all the generations, the second gets rid of the GDG base.

Code: Select all

  DEL PGMR.UPSTREAM.DOM1.BACKUP.*  PURGE
  DEL PGMR.UPSTREAM.DOM1.BACKUP GDG
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Delete all the generations in GDG.

Post by Anuj Dhawan »

Removing the egg from face slowly... :oops:

I had this IEFBR14 thing in mind and missed on the wild-card as part of parameter to IDCAMS:

Code: Select all

//STEPXXXX EXEC PGM=IEFBR14                          
//DELGDGS  DD   DSN=&ID..MY.GDG,                
//         DISP=(MOD,DELETE,DELETE),UNIT=SYSDA,      
//         SPACE=(CYL,(1,0))                        
//*
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Sanjana Kashyap
New Member
Posts: 5
Joined: Wed Jul 30, 2014 10:26 am

Re: Delete all the generations in GDG.

Post by Sanjana Kashyap »

Thanks guys!

There is no need to feel bad Anuj. Your solution alsohelped me.
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Delete all the generations in GDG.

Post by Anuj Dhawan »

Sanjana Kashyap wrote:There is no need to feel bad Anuj.
Thanks for the kind words Sanjana - it was a "self-talk", actually. And I realize that I should not have done this while having the fingers on key-board! :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”