# GDG Generation

**GDG GENERATION**

A generation is an individual dataset that belongs to a Generation Data Group (GDG).

Each time you create a new version of the same kind of data (for example, a daily report or a backup file) it becomes a new generation within the GDG

Generations are automatically named by the system with a generation number and a version number at the end like:\
MYDATA.BACKUP.REPORT.G0001V00, MYDATA.BACKUP.REPORT.G0002V00

All generations share the same GDG base name (MYDATA.BACKUP.REPORT in this example) but have different unique suffixes (GxxxxVxx)

If you run a backup job every night, each night's backup will be stored as a new generation under the same GDG base

**EXAMPLE**

```
//CRTEGEN   JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1     EXEC PGM=IEFBR14
//MYGDG     DD   DSN=MYDATA.BACKUP.REPORT(+1),
//               DISP=(NEW,CATLG,DELETE),
//               SPACE=(CYL,(1,1),RLSE),
//               UNIT=SYSDA,
//               DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
```

**Explanation:**

* **JOB Statement:**\
  Starts the job named CRTEGEN.
* **EXEC Statement:**\
  Runs the IEFBR14 utility to create a dataset without doing any processing.
* **DD Statement:**
  * DSN=MYDATA.BACKUP. REPORT(+1):\
    Creates a new generation under the GDG base(MYDATA.BACKUP.REPORT). (+1) means "next generation" or "new generation"
  * DISP=(NEW,CATLG,DELETE):\
    Creates and catalogs the dataset if successful, deletes it if the job fails.
  * SPACE=(CYL,(1,1),RLSE):\
    Allocates 1 cylinder initially and 1 cylinder as secondary.
  * UNIT=SYSDA:\
    Allocates on the default system storage device.
  * DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS):\
    Defines the dataset attributes: Fixed Block format, 80-byte record length, and it’s a sequential dataset.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://open-mainframe-project.gitbook.io/mainframe-open-education-project/chapter-2-mainframe-101-foundational-technology/job-control-language-and-system-display-and-search-facility/gdg/gdg-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
