JCL DELETE command - IBM Mainframe

Non-VSAM data sets can be deleted using the disposition parameter of the JCL DELETE command accomplishes the same objective for VSAM data sets. The following is a list of some of the objects that can be deleted with the DELETE command:

  • A KSDS, an ESDS, an RRDS, or an LDS base cluster
  • An alternate index
  • A path
  • A non-VSAM data set
  • A generation data group

Deleting a Base Cluster

A sample JCL for deleting a base cluster is given below:

Deleting a Base Cluster

This JCL would delete the data and index components of the base cluster, all the alternate indexes related to this base cluster and all the related paths. If now this base cluster is reallocated and reloaded, its alternate indexes will also have to be redefined and reloaded and the paths will also have to be redefined. The data and index components of a K5DS cannot be deleted separately.

Deleting an Alternate Index

Deleting an alternate index would delete both its data and index components and also delete any paths associated with it. A sample JCL for deleting an AIX cluster is given below:

Deleting an Alternate Index

As mentioned before, an alternate index that is not part of the upgrade set of a base duster can be brought in sync with the base cluster by:

  • Deleting the alternate index and thus any paths (using the DELETE command)
  • Redefining the alternate index (using the DEFINE AIX command)
  • Loading the alternate index (using the BLDINDEX command)
  • Establishing the paths (DEFINE PATH command)

Deleting a Path

Deleting a path only deletes the path entry. It does not affect the base cluster or the alternate index cluster. A sample JCL for deleting a path is given below:

Deleting a Path

Optional Parameters

ERASE - When a VSAM data set is deleted, only its catalog entry is removed and the space is freed up for future use. However, the data is not physically deleted. Using the ERASE parameter would, in addition to removing the catalog entry, physically overwrite the data component with binary zeroes.

PURGE - A data set can be allocated and given a retention period using the TO and FOR parameters of the DEFINE CLUSTER command. Such a data set cannot be deleted before the expiration date unless you use the PURGE parameter. Caution must be exercised while using this parameter.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics