Page 1 of 1

Are Empty and Scratch mutually exclusive in GDG?

Posted: Tue Jun 04, 2013 12:02 am
by Akshya Chopra
Hi,

While defining a GDG -- are Empty and Scratch mutually exclusive in GDG? I was asked this in a recent interview.

My answer was - No.

However, I was just thinking that what all combinations are practically possible:
  • Empty and Scratch?
  • Empty and No-Scratch?
  • No-Empty and Scratch?
  • No-Empty and No-Scratch?
Can someone please help?

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Fri Jun 07, 2013 12:55 pm
by Anuj Dhawan
You put a long question there Akshya, however, I'll try to explain... :)

Let's consider the below Job, which defines a GDG Base with limit=5 and NOEMPTY & SCRATCH are mentioned on DEFINE statement:

Code: Select all

//GDGIDXX1 EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
    DEFINE GDG(NAME(HLQ.DATA.GDGGROUP)   -
           LIMIT(5)                     -
           NOEMPTY                      -
           SCRATCH)
/*
//
This uses IDCAMS utility program to define a GDG base called HLQ.DATA.GDGGROUP that will consist of 5 generations.

The NOEMPTY parameter specifies that when the FIVE generation limit is reached the oldest generation data set will be deleted. The remaining generation data sets will be retained. An EMPTY parameter specifies that when the limit is reached the FIVE current files will be deleted and the process will start again with the new file. The SCRATCH parameter specifies that the oldest generation data set will be uncataloged and deleted when the generation limit is exceeded.

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Wed Jun 12, 2013 11:02 am
by Angel
So can we have these combinations for a GDG:
Akshya Chopra wrote:
  • Empty and Scratch?
  • Empty and No-Scratch?
  • No-Empty and Scratch?
  • No-Empty and No-Scratch?

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Tue Jul 23, 2013 12:52 pm
by Angel
I just tried these combinations and system allows them to be created - however, I was expecting that "Empty and Scratch" should not be allowed, I'm bit confused. Can someone please help?

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Tue Jul 23, 2013 3:07 pm
by Robert Sample
The AMS for Catalogs manual gives the parameters for DEFINE GENERATIONDATAGROUP and indicates the difference:
EMPTY|NOEMPTY Specifies what action is to be taken for the catalog entries for the GDG base when the number of generation data sets in the GDG base is equal to the LIMIT value and another GDS is to be cataloged. The disposition of the actual data sets uncatalogued from the GDG base is determined by the setting of the SCRATCH/NOSCRATCH parameter for the GDG base.

EMPTY remove all GDS entries from GDG base when a new GDS is created that causes the GDG LIMIT to be exceeded. Abbreviation: EMP
NOEMPTY remove only the oldest GDS entry when a new GDS is created that causes GDG LIMIT to be exceeded. Abbreviation: NEMP


SCRATCH|NOSCRATCH Specifies what action is to be taken for a generation data set located on disk volumes when the data set is uncataloged from the GDG base as a result of EMPTY/NOEMPTY processing. For generation data sets located on tape, this parameter has no effect. You can override the SCRATCH|NOSCRATCH attribute when issuing the DELETE command.

SCRATCH The GDS is deleted from all disks it occupies when uncatalogued from the GDG base, regardless of whether it is SMS-managed or not. Abbreviation: SCR
NOSCRATCH If the data set is a non-SMS managed data set it is not removed from any of the volumes it occupies. If the data set is an SMS-managed data set it is recataloged as a non-VSAM data set in rolled-off status, and is no longer associated with the GDG base. It is not deleted from any of the SMS-managed volumes it occupies. Abbreviation: NSCR
So the combination of EMPTY / SCRATCH indicates that when the GDG limit is reached and you attempt to add another generation, you want ALL existing generations removed from the catalog and you want those data sets deleted from the disk drives they are on, as well. These parameters are not mutually exclusive, so both can be used for a GDG.

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Sat Aug 03, 2013 10:15 am
by Akshya Chopra
Thanks Robert.

But is not it strange to allow such a combination such as EMPTY / SCRATCH...

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Sat Aug 03, 2013 6:12 pm
by Robert Sample
It may seem strange but the combination is allowed. IBM may have had a reason for allowing this combination but if so we may never know the reasons behind it.

Re: Are Empty and Scratch mutually exclusive in GDG?

Posted: Tue Aug 06, 2013 11:59 am
by Angel
Thanks Robert. :)