The best way to delete VSAM Secondary Index

Tips to delete VSAM index
[Tips to delete VSAM index]
In VSAM (virtual storage access method) deleting unused indexes is a task recently done in our workshop. IDCAMS is one of the best batch utility you can use to delete secondary index.

What is secondary index?

It is also called alternative index. RRDS, ESDS and KSDS have eligibility to define alternative index. But, primary index you define only on KSDS.

A KSDS has two parts: the index component and the data component. These may be stored on separate disk volumes.

While a basic KSDS only has one key (the primary key), alternate indices may be defined to permit the use of additional fields as secondary keys. An Alternate Index (AIX) is itself a KSDS. The data structure used by a KSDS is nowadays known as a B+ tree.

How to delete Secondary index?

While deleting a Cluster by using IDCAMS, it deltes internally all cluster, secondary index and path. So, you no need to delete all these separately.

More: What is relation between alternative index and Path

//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 DELETE test.vsam.file CLUSTER
/*

More: Top sample IDCAMS JCLs for all usages

Advertisements