The DB2® table definition that is used for a migrated RRDS data set is shown in Figure 1 . It uses the sample copybook shown in Figure 2 except that in this case the VSAM data set is an RRDS:
CREATE TABLE VID_ITEM
(RRN_NUMBER INTEGER
,ITEM_NUMBER CHAR(6)
,ITEM_NAME CHAR(12)
,ITEM_COLOUR CHAR(6)
,ITEM_WEIGHT CHAR(4)
,ITEM_COST DEC(7,2)
,ITEM_REORDER_NO SMALLINT
,ITEM_SUPP_CODE CHAR(3)
,ITEM_DATE_FSHIP DATE
,ITEM_SHELF_LIFE CHAR(2)
,ITEM_DESCRIPTION CHAR(35)
(PRIMARY KEY(RRN_NUMBER))
IN ITEMDB.ITEMTS;
The column RRN_NUMBER is defined as the DB2 primary key. The name of this column is optional, but to map an RRDS data set you must have an INTEGER column as the primary key of the DB2 table.