Page 1 of 1

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

Posted: Sun Oct 24, 2021 10:04 am
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.

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

Posted: Sun Oct 24, 2021 4:25 pm
by Robert Sample
IDCAMS can do this.

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

Posted: Tue Oct 26, 2021 12:52 am
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.

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

Posted: Tue Oct 26, 2021 3:30 am
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.

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

Posted: Tue Oct 26, 2021 12:06 pm
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?

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

Posted: Tue Oct 26, 2021 12:07 pm
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?

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

Posted: Wed Oct 27, 2021 12:45 am
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.

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

Posted: Wed Oct 27, 2021 8:58 am
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.