Are Empty and Scratch mutually exclusive in GDG?

All sort of Mainframes Interview Questions.
Post Reply
User avatar
Akshya Chopra
Registered Member
Posts: 76
Joined: Mon May 20, 2013 11:32 pm
Algeria

Are Empty and Scratch mutually exclusive in GDG?

Post 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?
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Are Empty and Scratch mutually exclusive in GDG?

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Are Empty and Scratch mutually exclusive in GDG?

Post 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?
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Are Empty and Scratch mutually exclusive in GDG?

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Are Empty and Scratch mutually exclusive in GDG?

Post 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.
User avatar
Akshya Chopra
Registered Member
Posts: 76
Joined: Mon May 20, 2013 11:32 pm
Algeria

Re: Are Empty and Scratch mutually exclusive in GDG?

Post by Akshya Chopra »

Thanks Robert.

But is not it strange to allow such a combination such as EMPTY / SCRATCH...
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Are Empty and Scratch mutually exclusive in GDG?

Post 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.
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Are Empty and Scratch mutually exclusive in GDG?

Post by Angel »

Thanks Robert. :)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”