Changing an edit procedure or a field procedure

You cannot use ALTER TABLE to change the assignment of an edit procedure or a field procedure. However, with the assistance of Db2 utilities, you can change an existing edit procedure or field procedure.

Procedure

To change an edit procedure or a field procedure for a table space in which the maximum record length is less than 32 KB, use the following procedure:

  1. Run the UNLOAD utility or run the REORG TABLESPACE utility with the UNLOAD EXTERNAL option to unload the data and decode it using the existing edit procedure or field procedure.

    These utilities generate a LOAD statement in the data set (specified by the PUNCHDDN option of the REORG TABLESPACE utility) that you can use to reload the data into the original table space.

    If you are using the same edit procedure or field procedure for many tables, unload the data from all the table spaces that have tables that use the procedure.

  2. Modify the code of the edit procedure or the field procedure.
  3. After the unload operation is completed, stop Db2.
  4. Link-edit the modified procedure, using its original name.
  5. Start Db2.
  6. Use the LOAD utility to reload the data. LOAD then uses the modified procedure or field procedure to encode the data.

What to do next

To change an edit procedure or a field procedure for a table space in which the maximum record length is greater than 32 KB, use the DSNTIAUL sample program to unload the data.