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:
- 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.
- Modify the code of the edit procedure or the field procedure.
- After the unload operation is completed, stop Db2.
- Link-edit the modified procedure, using its original name.
- Start Db2.
- 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.