Changing segment size

Using the reorganization utilities, you can increase or decrease segment size at the end of a segment type.

When increasing segment size, you are adding data to the end of a segment. When decreasing segment size, IMS truncates data at the end of a segment.

If you are increasing the size of a segment, you cannot predict what is at the end of the segment when it is reloaded. Also, new data must be added to the end of a segment using your own program after the database is reloaded.

To increase or decrease segment size:

Procedure

  1. Determine whether the change you are making affects the code in any application programs. If the code is affected, make sure it gets changed.
  2. Unload your database, using the existing DBD. If you are changing a HISAM database, you must use the HD UNLOAD/RELOAD utility since the HISAM utilities cannot be used to make structural changes.
  3. Code a new DBD. You need to change the BYTES= operand on the SEGM statement in the DBD to reflect the new segment size. If you are eliminating data from a segment for which FIELD statements are coded in the DBD, you need to eliminate the FIELD statements. If you are adding data to a segment and the data is referenced in the SSA in application programs, you need to code FIELD statements. No database updates are allowed between unload and reload.
  4. 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.
  5. Rebuild the ACB if you have ACBs prebuilt rather than build dynamically.
  6. Recalculate database space. You need to do this because the change you are making results in different requirements for database space.
  7. 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.
  8. Reload your database, using the new DBD. Make an image copy of your database as soon as it is reloaded.
  9. If your database uses logical relationships or secondary indexes, you must run reorganization utilities before and after reloading to resolve prefix information.