Rebuilding alternate indexes
If you delete and rebuild an alternate index (using BLDINDEX) it is equivalent to moving the alternate index data set.
About this task
It is possible that VSAM might be
holding locks on a unique key alternate index when you want to delete and
rebuild an alternate index. In this case, ensure that you preserve the locks
over the delete and rebuild process by setting ‘Recovery Required’
and transferring the locks to the rebuilt index. The steps you need to preserve
the locks across a rebuild are:
- Issue SHCDS FRSETRR to indicate the data set is under maintenance.
- Issue SHCDS FRUNBIND to get VSAM to save the locks, to be re-applied after the rebuild.
- Delete and redefine the alternate index.
- Rebuild the alternate index (using BLDINDEX).
- Issue FRBIND to bind the retained locks to the newly built alternate index.
- Issue SHCDS FRRESETRR to unset the under-maintenance flag.