Method 2. Converting segments or a database

Method 2 for converting segments or a database to use variable length segments involves creating two DBDs (an interim DBD and a final DBD), unloading the database, and then using a segment edit/compression exit routine to add the 2-byte size field during the reload of the database.

To convert selected segments or the entire database this way, you must:

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.
  3. Code and generate a new (interim) DBD. This DBD should specify fixed-length segments for all segments being converted to variable length. It should also specify the use of the segment edit/compression exit routine for each segment to be converted. (The interim DBD is used, as explained in Step 9, to add a size field to the existing fixed-length segments.)
  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 built dynamically.
  6. Recalculate database space if necessary. You need to do this when 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. Write an edit routine to which the segment edit/compression exit routine can exit. Your edit routine should add a size field to each segment it receives.
  9. Reload the database, using the interim DBD. As each occurrence of a segment type that needs to be converted is presented for loading, your edit routine gets control and adds the size field to the segment. When your edit routine returns control, the segment is loaded into the database. Remember to make an image copy of your database as soon as it is loaded.
  10. If your database uses logical relationships or secondary indexes, you must run reorganization utilities before and after reloading to resolve prefix information.
  11. After the database is loaded, code and generate a new DBD that specifies the segment types in the database that are variable, and their size.