WebSphere logo Classic Federation Server for z/OS, Version 9.1
WebSphere logo Classic Replication Server for z/OS, Version 9.1
WebSphere logo Classic Data Event Publisher for z/OS, Version 9.1
WebSphere logo Data Integration Classic Connector for z/OS, Version 9.1


Mapping tables and views for redefined data

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';
  1. Map two tables, each with an associated view.

    In the example, you define one base table and view for employee information, and another base table and view for address information.

  2. Use the view or the table, depending on whether you query or update the data.
    1. To query redefined data, supply filtering information in the view definition when you map the table. This approach simplifies queries in client applications, because the queries do not require WHERE clause filtering.
      Restriction: You cannot update a view.
    2. To insert, update, or delete redefined data, your application must use the base table name and provide WHERE filtering.

      Supply a WHERE clause and use the type code value to filter the records.

Tip: To perform change capture on redefined data, mark the view for change capture when you map the table.

For additional examples of working with redefined data, see Record types in data definition examples.

Related concepts
Mapping data for change capture
Mapping data for Classic federation
Record array definitions for federation and change capture
Related tasks
Creating Adabas tables and views for change capture
Creating CA-IDMS tables and views for change capture
Creating CICS VSAM tables and views for change capture
Creating IMS tables and views for change capture
Creating native VSAM tables and views for change capture
Altering tables to support change capture
Altering views to support change capture
Creating Adabas tables and views for Classic federation
Creating CA-Datacom tables and views for Classic federation
Creating CA-IDMS tables and views for Classic federation
Creating CICS VSAM tables and views for Classic federation
Creating tables and views for DB2 for z/OS databases
Creating IMS tables and views for Classic federation
Creating sequential tables and views for Classic federation
Creating VSAM tables and views for Classic federation
Creating indexes
Creating stored procedures
Modifying the PCB selection for IMS tables or indexes


Feedback

Update icon Last updated: 2007-10-09