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:
  1. Issue SHCDS FRSETRR to indicate the data set is under maintenance.
  2. Issue SHCDS FRUNBIND to get VSAM to save the locks, to be re-applied after the rebuild.
  3. Delete and redefine the alternate index.
  4. Rebuild the alternate index (using BLDINDEX).
  5. Issue FRBIND to bind the retained locks to the newly built alternate index.
  6. Issue SHCDS FRRESETRR to unset the under-maintenance flag.


dfht2c00226.html | Timestamp icon Last updated: Monday, 5 June 2017