Adding a secondary index to a full-function database

You can add a secondary index to a full-function database to process a segment type in a sequence other than the one defined by the key of the segment.

Procedure

To add a secondary index:

  1. Determine whether the change you are making affects the code in any application programs. If the code is affected, ensure that the code is changed.
  2. Unload the database by using the existing DBD and the HD Reorganization Unload utility.
  3. Code 2 new DBDs. one for the existing database and one for the new secondary index database.
  4. If the change you are making affects the code in application programs, make any necessary changes to the PSBs for those application programs. If you have the DB/DC Data Dictionary, it can help you determine which application programs and PCBs are affected by the DBD changes you have made.
  5. Optional: Rebuild the ACB if you have ACBs prebuilt rather than built dynamically.
  6. Delete the old database space and define new database space (non-VSAM), or delete the space allocated for the cluster and define space for the new cluster. In addition, define space for the secondary index.
  7. Reload the existing database, using the new DBD and the HD Reorganization Reload utility.
  8. Run the Database Prefix Resolution utility, using the DFSURWF1 work file that is output from Step 7 as input.
  9. Run the HISAM Reorganization Unload utility, using the DFSURIDX work file that is output from Step 8 as input. Indicate in the utility control statement that HISAM unload is being used to build a secondary index.
  10. Run the HISAM Reorganization Reload utility using as input the output from HISAM unload in Step 9.
  11. Change your JCL to add a DD statement for the secondary index data set even when you are not using the secondary index to process the main database.
  12. Change your reorganization procedures when adding a secondary index.
  13. When you reorganize the data set the secondary index points to, you must execute the reorganization utilities to rebuild the secondary index.