A column cannot be added to a table with the FIX attribute in which data is stored. If it is necessary to add a column to a table with the FIX attribute in which data is stored, you must use the following procedure:
- Procedure
- Use the pdrorg command to unload the table data.
- Use the PURGE TABLE statement to delete the table data.
- Use the ALTER TABLE statement to add a column.
- Use the pdhold command to shut down RDAREAs storing the table.
- Use the pdload command to load the table data.
- Use the pdcopy command to back up the table.
- Use the pdrels command to release the RDAREAs from shutdown status.
- Notes
- Either DAT or binary format can be used for unloading the table's data in step 1. It is preferable to use DAT format because it is a simpler operation.
- If the table contains character data that cannot be converted to DAT format (0x00 and 0x0a), the table data cannot be unloaded in DAT format; binary format must be used in such a case.
- For an example of unloading a table in DAT format, see 13.6.5 Example 4: Adding a column to a table with the FIX attribute (unloading in DAT format).
- For an example of unloading a table in binary format, see 13.6.6 Example 5: Adding a column to a table with the FIX attribute (unloading in binary format).