Altering GDG Parameters


Sometimes, there are some scenarios where we need to change the attributes of GDG. Modifying the parameters of a GDG involves altering the characteristics of the GDG base. This can be done using the IDCAMS utility in JCL.

Example -

Scenario - Let us assume the GDG is defined with NOEMPTY and has two generations, as shown below. Alter the GDG base with the EMPTY option.

MATEPK.TEST.GDG
MATEPK.TEST.GDG.G0001V00
MATEPK.TEST.GDG.G0002V00

Code -

----+----1----+----2----+----3----+----4----+
//MATEPKMG JOB (123),'MTH',CLASS=A,
//             MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//*
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
  ALTER MATEPK.TEST.GDG  EMPTY
/*

SYSPRINT in Spool -

Modifying GDG SYSPRINT

Explaining Example -

In the above example, we have modified the GDG parameter from NOEMPTY to EMPTY. The ALTER statement is used to modify the parameters of the MATEPK.TEST.GDG. The newly modified features are applied to all existing or new generations created for the GDG.