JCL Interview Questions and Answers (51 - 53)

51. How do you reference the output of step2 in step3 input when using Generation Data Groups (GDGs)?

In a job where each step creates a new generation of a GDG:

  • Step1: Uses the current generation as input and creates a new generation (+1) as output.
  • Step2: Uses generation (+1) as input and creates generation (+2) as output.
  • Step3: To use the output from Step2, reference it as generation (+2).

52. What is a Generation Data Group (GDG)?

A Generation Data Group (GDG) is a set of related datasets organized either by time or function. Each dataset within a GDG is called a generation and is assigned a unique version number. This structure allows efficient management and retrieval of datasets that belong to a series, such as daily logs or backups.

53. How is a GDG base created?

A GDG (Generation Data Group) base is created using the IDCAMS utility with the DEFINE GDG command. Here's an example:

//GDGBASE JOB ...
//CREATEGD EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE GDG (NAME(YOUR.GDG.BASE) -
              LIMIT(5) -
              NOEMPTY -
              SCRATCH)
/*

After defining the GDG base, individual generations (G0001V00, G0002V00, etc.) can be created in JOBs.