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