If you decide that you have to convert a migrated data set from DB2® back to VSAM, uses a 4-step procedure:
//VIDUNLOD EXEC PGM=VIDUNLOD
//STEPLIB DD DSN=appl.DRIVERS.LOAD,DISP=SHR
// DD DSN=VID.SVIDLODE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//FILEIN@ DD DSN=dummy.VSAM.dataset,DISP=SHR
//FILEIN DD SUBSYS=(ssi,DB2id,dimname)
//FILEOUT DD DSN=vsam.file,DISP=SHR
The output data set FILEOUT will have an 8-byte prefix for KSDS files and a 12-byte prefix for RRDS files. In both cases, the first four bytes will be the file type (KSDS, RRDS, KSDV, or RRDV). The next four bytes will contain the length of the record, in binary format. For RRDS data sets, the next four bytes contain the relative record number. The remainder of the record will be the data.
Use the IDCAMS utility to delete and define the base VSAM cluster.
Use the CICS VT batch utility program VIDLOADV to load the data from DB2 into a VSAM data set. Sample JCL is provided in the member VIDLOADV in VID.SVIDSAMP and is also shown in next:
//VIDLOADV EXEC PGM=VIDLOADV
//STEPLIB DD DSN=VID.SVIDLODE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//LOADIN DD DSN=vsam.DB2unload,DISP=SHR
//LOADOUT DD DSN=vsam.file,DISP=SHR
The steps in this fallback process can be combined into a single job to minimize the time it takes to fall back.
Use the IDCAMS utility to define the alternate index cluster and path and build the alternate index path entries.
If you are falling back to VSAM temporarily, you can use the VTMM transaction to set the CICS® file migration status to INACT. Otherwise, remove the entry for this DIM from the CICS VT DST.
If you use AJF, add the DIM for the file to VIDFMSPX. Otherwise, reverse the JCL changes.