Can we delete all versions of a GDG and just keep base.

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
Bala Kumar
Registered Member
Posts: 16
Joined: Sun Oct 20, 2013 2:04 pm

Can we delete all versions of a GDG and just keep base.

Post by Bala Kumar »

Hi,

Can someone please advise me if we can delete all versions of a GDG and just keep base of it. I tried to delete them using ISPF 3.4, locating and deleting them one by one for test. But is there a way to do it using some program or utility? Please advise.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Can we delete all versions of a GDG and just keep base.

Post by Robert Sample »

IDCAMS can do this.
mucka
New Member
Posts: 2
Joined: Tue Jan 31, 2017 1:13 am

Re: Can we delete all versions of a GDG and just keep base.

Post by mucka »

We used to delete the gig base. That deleted all versions. We then redefined the gig base. This was the most straightforward method for our process.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Can we delete all versions of a GDG and just keep base.

Post by Robert Sample »

Use IDCAMS command

Code: Select all

  DELETE GDG.BASE.NAME.*
which will remove all the generations while leaving the GDG base cataloged. In many applications, this will be better than deleting the base name and redefining it.
Bala Kumar
Registered Member
Posts: 16
Joined: Sun Oct 20, 2013 2:04 pm

Re: Can we delete all versions of a GDG and just keep base.

Post by Bala Kumar »

Hi Robert,

I hve used the following:

Code: Select all

//PGM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (YOUR.INPUT.GDG) GDG
But it gave me RC=8. Then I tried:

Code: Select all

//PGM EXEC PGM=IEFBR14
//GDGB DD DSN=YOUR.INPUT.GDG,
// DISP=(OLD,DELETE,DELETE)
It deleted all versions of it. Which one is better?
Bala Kumar
Registered Member
Posts: 16
Joined: Sun Oct 20, 2013 2:04 pm

Re: Can we delete all versions of a GDG and just keep base.

Post by Bala Kumar »

mucka wrote: Tue Oct 26, 2021 12:52 am We used to delete the gig base. That deleted all versions. We then redefined the gig base. This was the most straightforward method for our process.
How have you managed to copy the GDG base with same properties again?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Can we delete all versions of a GDG and just keep base.

Post by Robert Sample »

I hve used the following:
CODE: SELECT ALL

//PGM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (YOUR.INPUT.GDG) GDG
But it gave me RC=8.
If YOUR.INPUT.GDG has generations, I would expect the return code to be 8. The process you should use is

Code: Select all

//PGM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  DELETE YOUR.INPUT.GDG.* 
  DELETE YOUR.INPUT.GDG GDG
That is, delete the generations then you can delete the GDG.
How have you managed to copy the GDG base with same properties again?
Many sites have standard jobs to define their GDGs.
Bala Kumar
Registered Member
Posts: 16
Joined: Sun Oct 20, 2013 2:04 pm

Re: Can we delete all versions of a GDG and just keep base.

Post by Bala Kumar »

Thank you.

With this
Many sites have standard jobs to define their GDGs.
I was asking why would we delete a GDG base and then again recreate it? We should just keep the base intact when we require it again.
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 “Other Mainframe Topics, Off-Topics, FAQs.”