GDG base

Generation Dataset Group base

A GDG base is a catalog entry that defines the common part of the name for all generation datasets.

It doesn't store any data itself but controls how generations are created and managed

It sets the rules like how many generations can exist and what happens when the limit is reached

Before using a gdg we need to create a gdg base using the IDCAMS utility. once the base is created we can start creating generations (individual datasets) under it.

EXAMPLE

Creating a GDG base with a 5-Generation Limit automatically deleting the oldest when the limit is reached

//MYJOB   JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP01  EXEC PGM=IDCAMS
//SYSIN   DD  *
   DEFINE GDG(NAME(MYDATA.BACKUP.REPORT) -
          LIMIT(5)       -
          NOEMPTY        -
          SCRATCH)
/*

EXPLANATION:

  • DEFINE GDG

    • Command used to create a new GDG base entry in the catalog.

  • NAME(MYDATA.BACKUP.REPORT)

    • Specifies the name of the GDG base.

    • All generations created under this base will start with MYDATA.BACKUP.REPORT.

  • LIMIT (5)

    • Defines the maximum number of generations that can exist at the same time.

    • Here, up to 5 generation datasets are allowed.

  • NOEMPTY

    • When the limit is reached, only the oldest generation is deleted.

    • Recent generations are retained.

  • SCRATCH

    • When a generation is deleted, it is removed completely from both catalog and disk.

    • The dataset cannot be recovered later.

Last updated

Was this helpful?