Use the CICS® VT batch utility program VIDLOAD to convert the unloaded data set produced by the VIDUNLOD utility program into the correct format for the DB2® load utility.
Sample JCL for this utility can be found in member VIDLOAD in VID.SVIDSAMP, as follows:
//VIDLOAD EXEC PGM=VIDLOAD,PARM=dimname
//STEPLIB DD DSN=appl.drivers.load,DISP=SHR
// DD DSN=VID.SVIDLODE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//LOADIN DD DSN=appl.sequential.unload,DISP=SHR
//LOADOUT DD DSN=appl.sequential.db2load,UNIT=SYSDA,
// DISP=(,CATLG,DELETE),RECFM=FB,LRECL=100,
// SPACE=(CYL,(25,5),RLSE)
The record length for the DB2 load file must consider any data re-engineering that affects the length of the DB2 row. For example, assume your VSAM record length is 100 bytes and contains a 6 byte unsigned zoned decimal field mapped to a DEC(6,0) column. DEC(6,0) is 4 bytes, so the DB2 row is 2 bytes less than the VSAM record. If, however, your file has a 5-byte packed decimal date field mapped to a DATE column, which is 10 bytes in DB2, the row is 5 bytes longer than the VSAM record. The most reliable method to establish the length of the DB2 row is to review the load utility input statement, and add the length of the last column to its position. In Figure 2, the last column ITEM_DESCRIPTION is 35 bytes starting in position 50. The DB2 row length in this case is 84 bytes.
LOAD DATA LOG NO INDDN SYSREC00 NOCOPYPEND
INTO TABLE
CIRDL.VID_ITEM
(
ITEM_NUMBER POSITION( 1 )
CHAR( 6) ,
ITEM_NAME POSITION( 7 )
CHAR( 12) ,
ITEM_COLOUR POSITION( 19 )
CHAR( 6) ,
ITEM_WEIGHT POSITION( 25 )
CHAR( 4) ,
ITEM_COST POSITION( 29: 32)
DECIMAL ,
ITEM_REORDER_NO POSITION( 33 )
SMALLINT ,
ITEM_SUPP_CODE POSITION( 35 )
CHAR( 3) ,
ITEM_DATE_FSHIP POSITION( 38 )
DATE EXTERNAL( 10) ,
ITEM_SHELF_LIFE POSITION( 48 )
CHAR( 2) ,
ITEM_DESCRIPTION POSITION( 50 )
CHAR( 35) )
The VIDLOAD utility issues the following message at the end of the job:
+VIDLOAD
+VIDLOAD - DB2 LOADFILE FOR VSAM WRITTEN TO LOADOUT
+VIDLOAD