List a Generation Data Group's Entries, Then Delete the Group and Its Data Sets in a Catalog: Example 11

In this example, a generation data group, GDG01, and its associated (generation data set) entries are listed, the only generation data set in the group is deleted, and the generation data group base catalog entry is deleted.
//DELET9    JOB   ...
//STEP1     EXEC  PGM=IDCAMS
//SYSPRINT  DD    SYSOUT=A
//SYSIN     DD    *
     LISTCAT -
            ENTRIES(GDG01) -
            ALL
     DELETE -
            GDG01.G0001V00 -
       DELETE -
            GDG01 -
            GENERATIONDATAGROUP -
            PURGE
/*
The LISTCAT command lists the generation data group, GDG01, and its associated generation data set entries. The parameters are:
  • ENTRIES specifies that the entry GDG01 be listed. Because GDG01 is a generation data group entry, its associated generation data set's (non-VSAM) entries are also listed. If one of the generation data sets has aliases, the alias entries associated with the generation data set's entry are listed.
  • ALL specifies that all fields are to be listed.

    The first DELETE command removes the non-VSAM data set entry for the only generation data set, GDG01.G0001V00, in the generation data group. Its parameters are:

  • GDG01.G0001V00 is the entryname of the object being deleted. GDG01.G0001V00 identifies the only generation data set in generation data group GDG01.
  • GDG01 is the entryname of the object being deleted. GDG01 identifies the generation data group base entry.
  • GENERATIONDATAGROUP specifies the type of entry being deleted. VSAM verifies that GDG01 is a generation data group entry, then deletes it. If GDG01 incorrectly specifies another type of entry, VSAM does not delete the entry, but notes the discrepancy with a message to the programmer.
  • PURGE specifies that the generation data group's retention period or date be ignored.