Redefined data uses alternate record layouts for the same storage area, based on record types.
To read redefined data, define a table with an associated view for each type of record. To insert, update, delete, or capture changes to redefined data, define a separate table for each record type.
Each table you map for redefined data must contain columns that identify common key information and a column for the type code field. These columns are followed by type-specific columns.
In the following PL/I example, the UNION attribute defines two alternative record mappings for the same storage area. The RECORD_TYPE variable specifies whether the data that follows describes employee information or address information.
DCL 01 EMPLOYEE_ADDRESS_RECORD, 05 EMP_ID CHAR(6), 05 RECORD_TYPE CHAR(1), 05 RECORD_INFO UNION, 10 EMPLOYEE_INFORMATION, 15 LAST_NAME CHAR(20), 15 FIRST_NAME CHAR(20), 15 DATE_OF_BIRTH PIC '(8)9', 15 MONTHLY_SALARY DECIMAL(7,2), 15 FILLER CHAR(48), 10 ADDRESS_INFORMATION, 15 ADDRESS_LINE_1 CHAR(30), 15 ADDRESS_LINE_2 CHAR(30), 15 ADDRESS_CITY CHAR(20), 15 ADDRESS_STATE CHAR(2), 15 ADDRESS_ZIP PIC '(5)9';
For additional examples of working with redefined data, see Record types in data definition examples.