Delete JCL for GDG base and VSAM cluster

The below jcl we can use to delete GDG bases. The interesting point is if we delete GDG base, automatically it deletes all the versions.

//Step1   EXEC  PGM=IDCAMS

//SYSIN   DD   *

   DELETE ‘XXXX.XXXX.XXXX.XXX’ GDG FORCE

/*

(or) if we want to delete migrated-GDGS,  use the following syntax.

//Step1   EXEC  PGM=IDCAMS

//SYSIN   DD   *

   HDELETE ‘XXXX.XXXX.XXXX.XXX’ GDG FORCE

/*

Note: To delete VSAM clusters, give CLUSTER in place of GDG.

There are two optional parameters usually we give with DELETE.

FORCE: It deletes all clusters in the catalogue.

NOFORCE: It deletes empty catalogue. If the catalogue does have cluster entries, it will not delete.

PURGE: Even though GDG has retention period, it deletes all entries.

NOPURGE: When the GDG has retention period, it will not delete the entries.

With IDCAMS utility we can delete GDG clusters and VSAM clusters. 

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.