Unlike VSAM,
DB2®
enforces data value rules according
to the data type of the column.
When your
DB2
table includes column types of DECIMAL, INTEGER,
SMALLINT, DATE, or TIME, a degree of data cleansing might be required
regardless of whether you use
CICS®
VT re-engineering or not.
This is illustrated by examining how certain fields in the data set
copybook shown in
Figure 2
are
mapped.
Copybook field |
Picture |
ITEM-COST |
S99999V99 COMP-3 |
ITEM-REORDER-QUANTITY |
S999 |
ITEM-FIRST-SHIP-DATE |
S(9) COMP-3 |
These fields are mapped to the following columns:
DB2
column
|
Data type |
ITEM_COST |
DEC(7,2) |
ITEM_REORDER_NO |
SMALLINT |
ITEM_DATE_FSHIP |
DATE |
CICS
VT
automatically converts the data values in these three fields. If any
record in either the field ITEM-REORDER-QUANTITY or ITEM-COST contains
invalid data, the VIDLOAD program will abend with an S0C7 in the
CICS
VT
module VIDCONV. The offending field value can be identified from the
dump produced by the S0C7 abend as follows:
- Register 0 contains the address of the invalid field value.
- Register 8 contains the address of the
CICS VT VIDFBEP control block. The
CICS
VT field name is four fullwords down VIDFBEP.
The format of the VIDFBEP control block is explained in the
CICS VT for z/OS Data Reengineering and
Customization Guide. Invalid data for the ITEM-FIRST-SHIP-DATE
field does not result in an S0C7 abend, but causes an error in
the
DB2
LOAD utility. For example, a value of x'000999999C'
or spaces cannot be converted into valid
DB2 DATE
column values, and will produce the following error:
DSNU334I -DB2B DSNURWBG - INPUT FIELD 'col-name' INVALID
FOR 'table-name', ERROR CODE '14'