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:
- 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.
- Unload the database by using the existing DBD and the HD Reorganization Unload utility.
- Code 2 new DBDs. one for the existing database and one for the new secondary index database.
- 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.
- Optional: Rebuild the ACB if you have ACBs prebuilt rather than built dynamically.
- 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.
- Reload the existing database, using the new DBD and the HD Reorganization Reload utility.
- Run the Database Prefix Resolution utility, using the DFSURWF1 work file that is output from Step 7 as input.
- 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.
- Run the HISAM Reorganization Reload utility using as input the output from HISAM unload in Step 9.
- 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.
- Change your reorganization procedures when adding a secondary index.
- When you reorganize the data set the secondary index points to, you must execute the reorganization utilities to rebuild the secondary index.