CoreDataset
Defining and managing a GDG
Creating the group, and what the options actually do.
//DEFGDG EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE GDG ( - NAME(PROD.PAY.BAL) - LIMIT(14) - keep 14 generations SCRATCH - physically delete when rolled off NOEMPTY ) roll off only the oldest, not all /*
| Option | Effect |
|---|---|
| LIMIT(n) | How many generations are kept, 1 to 255 |
| SCRATCH | Delete the data when a generation rolls off |
| NOSCRATCH | Uncatalog only; the data stays on the volume |
| EMPTY | When the limit is reached, uncatalog ALL generations |
| NOEMPTY | Uncatalog only the oldest — almost always what you want |
Working with generations
| Reference | Means |
|---|---|
| (0) | The current generation |
| (-1), (-2) | Previous generations |
| (+1) | A new generation created by this job; stays (+1) for the whole job |
| No reference at all | Every generation, concatenated newest first |
Stuck on something else?
Ask the community or search the full course.