Deleting segment types

You can delete a segment type from a database by using either the reorganization utilities provided by IMS or by using your own unload and reload program.

You can delete a segment type from a database, using the reorganization utilities, if:

  • The existing relative order of segments in the database record does not change. In other words, the existing parent to child relationships cannot change.
  • The existing segment names do not change.

To use the reorganization utilities to delete a segment type from the database:

Procedure

  1. Code and execute an application program to delete all occurrences of the segment type being deleted. You must code and execute the application program before the database is unloaded.
  2. Determine whether the change you are making affects the code in any application programs. If the code is affected, make sure it gets changed.
  3. Unload your database, using the existing DBD.
  4. Code a new DBD. You need to remove SEGM= statements from the DBD for:
    • The segment type being deleted
    • The children of the deleted segment.
  5. If the change you are making affected 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.
  6. Recalculate database space.
    You need to do this because the change you are making will result in different requirements for database space.
  7. Rebuild the ACB if you have ACBs prebuilt rather than built dynamically.
  8. For non-VSAM data sets, delete the old database space and define new database space. For VSAM data sets, delete the space allocated for the old clusters and define space for the new clusters.
  9. Reload your database using the new DBD. Remember to make an image copy of your database as soon as it is reloaded.
  10. If your database uses logical relationships or secondary indexes, you must run reorganization utilities before and after reloading to resolve prefix information.