Mainframe Open Education Project
  • Welcome: Learn & Contribute to MOE
    • MOE Vision, Mission and Content Phases
    • Who Can Contribute?
    • Contributor Log In
    • Earn A Contributor Badge
    • MOE Management System
    • MOE Events
    • Project Support
    • Legal Disclaimer, Copyright and License
    • Code of Conduct
    • Project Governance
    • Why MOE
  • Introduction: What is Enterprise Computing?
  • Chapter 1: What is a Mainframe Today?
    • Role of the Mainframe Today
      • Mainframe and the Cloud
      • Enterprise Computing
      • Hybrid Cloud
    • Who Uses the Mainframe and Why
    • Mainframe versus Server
    • Mainframe Basic Architecture & Components
    • How the Mainframe Works
    • Mainframe Security Myths
    • Mainframe Evolution
    • Mainframe Modernization
    • Video: ITs Best Kept Secret
    • Get Ready: Talk Like a Mainframer
    • Looking Back: The First 50 Years of Mainframe
  • Chapter 2: Foundational Technology
    • Brief Introduction to z/OS
    • TSO/E, ISPF, and UNIX System Services (USS): Interactive facilities of z/OS
    • Data Sets and How They Work
    • Job Control Language and System Display and Search Facility
      • Understanding the JCL(Job Control Language)
        • Understanding the JOB Statement
        • Understanding the EXEC Statement
        • Understanding the DD Statement
        • Creating a Physical Sequential (PS)
        • Understanding Libraries in JCL
        • Understanding Instream Procedures, Cataloged Procedures, and Symbolic Parameters in JCL
      • Utilities
        • IEBCOMPR
        • IEBGENER
          • Copying Between Sequential Datasets and PDS Members Using IEBGENER
          • Generate PDS member while copying
          • Copying a UNIX File to a PS File
        • IEBCOPY
          • IEBCOPY selective copy using select statements
          • IEBCOPY Exclude members while copying
          • IEBCOPY renaming member while copying
      • GDG
        • GDG parameters
        • GDG base
        • GDG Generation
          • Referencing GDG Generations Using Relative Numbers
        • Alter and Delete GDG
    • Enterprise Software Development and Implementation
    • Programming languages for Mainframe
    • Modern Application Management
    • Video: System Overview
    • Video: MVS Using Dynamic Allocations
    • Article: Red Hat OpenShift 4.7 on IBM Z Is a Game Changer for Container Orchestration and Managemen
    • IBM z16
  • Chapter 3: Roles in Mainframe
    • Roles and Categories
      • Category Definitions
  • Chapter 4: Deeper Dive in Role Chosen
    • IT Operations and System Support and Services
    • IT Business/Software Product Application Development and Support
    • IT Software Engineers
    • IT Architects
  • Chapter 5: Career Path Opportunities
    • Learning Programs
    • Job Opportunities
    • Career Event Calendar
    • Open to Hire
  • Mainframe Events and Conferences 2024
  • My Mainframe Journey: From Student to Professional
  • Backlog on Topics
  • Additional Community Resources
    • Communities
    • Courses, Tutorials, Manuals
    • Education Programs
    • IBM Mainframe Timeshare Services
  • Digital Certificate Badges
    • z/OS Mainframe Practitioner
  • Reviewer List
  • Modern Mainframe
    • What is a modern mainframe environment?
    • z/OSMF
      • What is z/OSMF?
      • Why it is important in a mainframe shop
      • z/OSMF Learning Materials
    • Zowe
Powered by GitBook
On this page

Was this helpful?

  1. Chapter 2: Foundational Technology
  2. Job Control Language and System Display and Search Facility
  3. GDG

Alter and Delete GDG

ALTERing a GDG Base

Sometimes after creating a GDG base you might realize you need to change its properties like increasing the limit of generations or switching from NOEMPTY to EMPTY.

Instead of deleting and recreating the base you can simply use the ALTER command to update the existing GDG base definition

You can change attributes like LIMIT, EMPTY/NOEMPTY, and SCRATCH/NOSCRATCH.

You cannot change the GDG name with ALTER command you would need to delete and recreate if you want a new name.

EXAMPLE

//ALTERGDG JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP01  EXEC PGM=IDCAMS
//SYSIN   DD  *
    ALTER MYDATA.BACKUP.REPORT LIMIT(10)
/*

Explanation:

This JCL alters the GDG base MYDATA.BACKUP.REPORT to allow 10 generations instead of its previous limit.

DELETEing a GDG Base:

If you no longer need a GDG base (and its associated generations), you can use the DELETE command.

If the generations were created with SCRATCH, they will be completely removed from both catalog and disk.

If the generations were created with NOSCRATCH, they will be uncataloged only and still reside on disk. You will need to know their exact names to access them later.

EXAMPLE:

MYDATA.BACKUP.REPORT <-----— GDG base MYDATA.BACKUP.REPORT.G0001V00 <-----— GDG generation MYDATA.BACKUP.REPORT.G0002V00 <-----— GDG generation MYDATA.BACKUP.REPORT.G0003V00 <-----— GDG generation

//DELETEGDG JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP01    EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
     DELETE MYDATA.BACKUP.REPORT GDG FORCE or PURGE
/* 

Explanation:

DELETE MYDATA.BACKUP. REPORT: Specifies the name of the GDG base that you want to delete.

GDG:Tells the system that the target to be deleted is a Generation Data Group (GDG) base not a regular dataset.

FORCE:Used to delete the GDG base even if it has active generation datasets under it.deletes the base along with all of its generations.

PURGE:Forces the delete, even if the dataset is in use or protected. Useful when normal delete doesn't work

PreviousReferencing GDG Generations Using Relative NumbersNextEnterprise Software Development and Implementation

Last updated 6 days ago

Was this helpful?