Consider the data set analyzed by the automated mapping facility in Figure 1.
--------------------- CICS VT: Edit columns in VIDKSDS2 ------- Row 4 from 14
Command ===> ________________________________________________ Scroll ===> CSR
Commands: MAP SAVE PREVIEW SUSPEND/RESUME CHANGE/UNDO SHOW
Actions: S Display, U Update, D Delete, I Insert Status message /
A Pos Copybook field name / DB2 column name Type Len Exit Pic Par
- ----- ----+----1----+----2----+----3----+---- ---- ----- -----------------
_ 25 ITEM-HEIGHT + 4
ITEM_HEIGHT................... + CHAR 4
_ 29 ITEM-COST + 4
ITEM_COST..................... + DEC 7,2
_ 33 ITEM-REORDER-QUANTITY + 3
ITEM_REORDER_QUANTITY......... + DEC 3,0
_ 36 ITEM-SUPPLIER-CODE + 3
ITEM_SUPPLIER_CODE............ + CHAR 3
_ 39 FSHIP-CC + 2
FSHIP_CC...................... + DEC 2,0
_ 41 FSHIP-YY + 2
FSHIP_YY...................... + DEC 2,0
_ 43 FSHIP-MM + 2
FSHIP_MM...................... + DEC 2,0
_ 45 FSHIP-DD + 2
FSHIP_DD...................... + DEC 2,0
_ 47 ITEM-SHELF-LIFE + 2
ITEM_SHELF_LIFE............... + CHAR 2
_ 49 ITEM-DESCRIPTION + 35 Redefined field 1
ITEM_DESCRIPTION.............. + CHAR 35
_ 49 ITEM-DETAILS-1 + 35 Redefined field 1
ITEM_DETAILS_1................ + CHAR 35
The fields FSHIP_CC, FSHIP_YY, FSHIP_MM and FSHIP_DD are each 2 bytes and represent a date. CICS® VT lets you combine these fields and map them to a single DATE column in DB2®. To do this requires the delete column and insert column functions.
You can only insert a new column or columns if the position in the record is not already assigned to a DB2 column. The four date fields are initially mapped to four 2-byte CHAR columns and they must be deleted before a new DATE column can be inserted. This is shown in Figure 2.
--------------------- CICS VT: Edit columns in VIDKSDS2 ------- Row 4 from 14
Command ===> ________________________________________________ Scroll ===> CSR
Commands: MAP SAVE PREVIEW SUSPEND/RESUME CHANGE/UNDO SHOW
Actions: S Display, U Update, D Delete, I Insert Status message /
A Pos Copybook field name / DB2 column name Type Len Exit Pic Par
- ----- ----+----1----+----2----+----3----+---- ---- ----- -----------------
_ 25 ITEM-HEIGHT + 4
ITEM_HEIGHT................... + CHAR 4
_ 29 ITEM-COST + 4
ITEM_COST..................... + DEC 7,2
_ 33 ITEM-REORDER-QUANTITY + 3
ITEM_REORDER_QUANTITY......... + DEC 3,0
_ 36 ITEM-SUPPLIER-CODE + 3
ITEM_SUPPLIER_CODE............ + CHAR 3
d 39 FSHIP-CC + 2
FSHIP_CC...................... + DEC 2,0
d 41 FSHIP-YY + 2
FSHIP_YY...................... + DEC 2,0
d 43 FSHIP-MM + 2
FSHIP_MM...................... + DEC 2,0
d 45 FSHIP-DD + 2
FSHIP_DD...................... + DEC 2,0
_ 47 ITEM-SHELF-LIFE + 2
ITEM_SHELF_LIFE............... + CHAR 2
_ 49 ITEM-DESCRIPTION + 35 Redefined field 1
ITEM_DESCRIPTION.............. + CHAR 35
_ 49 ITEM-DETAILS-1 + 35 Redefined field 1
ITEM_DETAILS_1................ + CHAR 35
After the columns are deleted, you can insert the new DATE column. Specify I against the column name ITEM_SUPPLIER_CODE to enter the new column details. The details that you need to enter are shown in Figure 3:
--------------------------- CICS VT: Insert column --------------------------
Command ===> ________________________________________________ Scroll ===> CSR
Enter new field and column attributes:-
Copybook field:
position ==> 39___
length ==> 8___
data type ==> C (C,P,U,F,H,B)
Column:
name ==> ITEM_DATE_FIRST_SHIPPED........................... +
length ==> _____ Optional (if DEC specify x,y)
data type ==> DATE (CHAR,DEC,INT,SINT,BINT,DATE,TIME,TIMS)
Mapping:
picture / FBE ==> CCYYMMDD_________ (example HH.XX.SS.NNNNNN)
(or MMDDYY)
(or EXITx=exit name)
parameters ==> __________________________ Optional user parameters
Press: Enter to confirm PF3 to exit PF1 for help
The Insert column screen displays the position in the VSAM record that the new column will map to. It also displays the length of the area that is not mapped. Figure 3 shows the position is 39 and the length is 8. You must specify the data type of the VSAM field as one of the following values:
Next you must specify details of the new column to be inserted. If the data type is DEC, you must specify a scale and precision in the Column length field. You do not have to specify a column length if the column data type is fixed length (INT, SINT, BINT, DATE, TIME, or TIMS).
You are prompted for a picture string if the Column data type is DATE, TIME, or TIMS. See Specifying a picture string.