In Step1 gdgname(+1) has been created and step1 executed successfully. In Step 2 if same data set need to be used. How to refer it?
-
Gdgname(0)
-
Gdgname(+1)
-
Gdgname(-1)
-
Gdgname(+2)
When a GDG generation is created with gdgname(+1) in Step 1, it becomes the current generation. In subsequent steps, you reference it as gdgname(0), which always points to the most recent generation. The (+1) notation creates a new generation, while (0) references the existing one.
GDG (Generation Data Group) relative generation numbers like (+1), (0), (-1) are resolved based on the catalog state at the start of the job, not updated dynamically mid-job as steps execute. When Step1 creates a new generation referenced as GDGNAME(+1), that same newly-created generation is still referred to as GDGNAME(+1) in a later step of the same job — the catalog only re-numbers generations (so what was +1 becomes 0) once the job completes and the catalog is updated. So to reuse the dataset just created in Step1, Step2 must still reference GDGNAME(+1), not (0) — (0) would refer to the most recent generation as of the job's start, which is the prior generation, not the new one just created in this job.