IDCAMS – Create and delete GDG base using JCL

IDCAMS Utility can be used to create a GDG base, as well as deleting an existing base.
Define a GDG base:

//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 DEFINE GENERATIONDATAGROUP (NAME(gdg.base) -
 NOEMPTY SCRATCH LIMIT(4))
/*

Delete/Purge a GDG base and all the included files:

//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 DELETE gdg.base GDG FORCE
/*

Delete/Purge a GDG base (base only, there should not be any versions):

//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 DELETE gdg.base PURGE
/*

Learn more on GDG bases

Advertisement

3 thoughts on “IDCAMS – Create and delete GDG base using JCL”

  1. Need to delete all generations of the gdg prior to deletion of the base. This is the reason for Kaniska’s error, encountered it as well. πŸ™‚
    Thanks for the code!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.