Convert a VSAM File to Multiple Datacom/DB Tables

Learn to convert a VSAM file with multiple record types to multiple Datacom/DB tables.
To convert a VSAM file with multiple record types to multiple MDB-related tables, complete the following procedure:
  1. Define the MDB-related tables in a Multiple
    Datacom/DB
    Table as described in Building Batch Multiple
    Datacom/DB
    Tables
    .
  2. Assemble and Link each Multiple
    Datacom/DB
    Table
    (MDT) for the source VSAM file.
  3. Code a control statement for the Conversion Aid Utility using the parameters that are described in Control Statement Format for MDB File, using the rules described in the following section on rules for coding control statements.
  4. Modify the JCL shown in Conversion Aid Utility JCL Examples substituting statements valid when input is a backup file for statements valid when input is a VSAM file, if applicable.
  5. Create a backup file by executing the Conversion Aid Utility with the control statement created in Step 3. Use as a model the JCL example.
  6. Verify the accuracy of the resulting Conversion Aid Utility Report. For an example, see Sample DVVMGPR Report (Conversion Aid Utility).
  7. Initialize the data area by executing the
    INIT AREA
    function of DBUTLTY.
  8. Code a control statement for the
    LOAD AREA
    function of DBUTLTY, specifying
    FORMAT=
    BACKUP
    .
  9. Convert the data to that area from the backup file that is created in Step 5 by executing the
    LOAD AREA
    function of DBUTLTY. For more information, see DBUTLTY JCL.

Rules for Coding Control Statements

Follow these steps:
  1. Enter an asterisk in column 1 to use the statement for comments. 
  2. Enter keywords and their values between columns 1 and 71. The Conversion Aid Utility terminates processing if any data is found outside this range.
  3. Code each keyword and its value on the same statement in the form KEYWORD=VALUE. That is, coding a keyword and its value on separate statements is not permitted.
  4. Use commas as delimiters. Blanks are not permitted except following the last parameter value to be specified. A comma following the last value that is specified on a statement indicates that another statement follows.
  5. Specify each required keyword with its value once and only once. Specify the optional keyword and its value, if the default is not acceptable.

Control Statement Format for MDB File

To prepare the load file for converting a VSAM file to MDB-related tables, execute the
Datacom VSAM Transparency
Conversion Aid Utility with a control statement prepared according to the following format:
►►─ MDTNM= ─ table-name,DDNAME=ddname,RKP=start-position,DBID=dbid ────► ►─ ,VRECDLN=max-rec-length,INRECFM= ─┬─ F ─┬──────────────────────────► └─ V ─┘ ►─┬───────────────────────────┬───────────────────────────────────────►◄ └─ ,INFILTYP= ─┬─ VSAM ◄ ─┬─┘ └─ BKUP ───┘

Required Keywords

DBID=
Identifies the
Datacom/DB
database ID in which the converted tables will reside. This value should match the
Datacom Datadictionary
DATACOM-ID for the DATABASE entity-occurrence.
Valid Entries:
21—5000
Default Value:
(No default)
DDNAME=
Identifies the DDname of the base cluster that is specified by the
DBMDTHDR
macro parameter,
DDNAME=
for the VSAM data set being converted.
Valid Entries:
Any valid DDname for the data set being converted
Default Value:
(No default)
INRECFM=
Indicates whether the record format of the data set being converted is fixed or variable. Examine RECORDSIZE (x, y) in the VSAM base cluster definition. If x=y, the file is fixed length; if x is less than y, the file may be variable-length.
  • If composed of fixed-length records, code
    INRECFM=
    F
  • If composed of variable-length records, code
    INRECFM=
    V
Valid Entries:
F, V
Default Value:
(No default)
MDTNM=
Identifies the name of the Multiple
Datacom/DB
Table containing conversion criteria for the file being converted. Specify the same name as the one coded for one of the following parameters:
Valid Entries:
Load Library member name
Default Value:
(No default)
RKP=
Indicates the starting position of the prime key relative to zero within the VSAM record of the base cluster referenced by
DDNAME=
. Use the value coded for one of the following parameters:
Valid Entries:
0 to 32767, but not exceeding the value for
VRECDLN=
.
Default Value:
(No default)
VRECDLN=
Indicates maximum record length. We recommend that you use the
VRECDLN=
value you assigned for this file in the corresponding VIT or the
Datacom Datadictionary
specification of MAX-RECORD-SIZE for the corresponding FILE entity-occurrence. If you do not use one of these values, ensure the length that you specify here accommodates the largest record you are loading.
Valid Entries:
1 to 32768
Default Value:
(No default)
INFILTYP=
(Optional)
Indicates the file type to be used for the input.
  • If loading from a VSAM file, accept the default,
    INFILTYP=
    VSAM
    .
  • If loading from a backup of a VSAM file, code
    INFILTYP=
    BKUP
    .
Valid Entries:
VSAM, BKUP
Default Value:
VSAM

Conversion Aid Utility JCL Examples

To create the input file to the
LOAD
function of
Datacom/DB
Utility (DBUTLTY), execute JCL using the following as a model. Then execute DBUTLTY with
FORMAT=
BACKUP
.
The JOB and JOBLIB statements are for example only. Code these statements according to site standards.
//jobname JOB 'xxxxxxx',CLASS=0,REGION=1000K,MSGCLASS=T //JOBLIB DD DSN=DATACOM.CAILIB,DISP=SHR // DD DSN=DATACOM.DBVT.CSILIB,DISP=SHR //*-------------------------------------------------------------------* //* EXECUTE CONVERSION AID UTILITY TO PREPARE DBUTLTY LOAD FILE * //*-------------------------------------------------------------------* //CAU EXEC PGM=DVVMGPR //SNAPER DD SYSOUT=* //PRINTER DD SYSOUT=*,DCB=(LRECL=133,BLKSIZE=133,RECFM=F) //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //VSAMFIL DD DSN=DATACOM.VSAM.BLA.KSDS, // DISP=(OLD) //MDBFILE DD DSN=DATACOM.BACKUP.DB400.BLA, // DISP=(NEW,CATLG,DELETE), // UNIT=TAPE, // LABEL=(1,SL), // DCB=(RECFM=VB,LRECL=571,BLKSIZE=4572) //CTLCARD DD * MDTNM=MDBBLA,DDNAME=BILLING,RKP=0,DBID=400,VRECDLN=563, INFILTYP=VSAM,INRECFM=V /* //
CAU EXEC PGM=DVVMGPR
Invokes the
Datacom VSAM Transparency
Conversion Aid Utility.
VSAMFIL DD DSN=DATACOM.VSAM.BLA.KSDS,
Statement valid if the input is a VSAM file.
Replace this statement with the following statement if the input is a backup of the VSAM file, that is, the result of the
REPRO
function of the IDCAMS program.
//BKUPFIL DD DSN=DATACOM.VSAM.BLA.REPRO,DISP=OLD
DCB=(RECFM=VB,LRECL=571,BLKSIZE=4572)
Code the MDBFILE statement's
DCB=
parameter as follows:
  • Code
    RECFM=
    VB
    regardless of whether the record format is variable blocked or fixed blocked.
  • Specify a value for
    LRECL
    that is 8 greater than the value specified for the maximum record size in the control statement. (In the sample JCL,
    LRECL=
    571
    while 563 is specified in the control statement.)
  • Specify a value for
    BLKSIZE
    that is 4 greater than a multiple of
    LRECL
    . (In the sample JCL,
    BLKSIZE=
    4572, which is 4 more than eight times the LRECL value of 571.)
MDTNM=MDBBLA,DDNAME=BILLING,RKP=0,DBID=400,VRECDLN=563,INFILTYP=VSAM,INRECFM=V
For an explanation of this control statement format, see Control Statement Format for MDB File.

Sample DVVMGPR Report (Conversion Aid Utility) 

DVVMGPR CONVERSION AID UTILITY VSAM TO MULTIPLE CA-DATACOM/DB TABLES DATABASE id= 400 INPUT = V,VSAM MDT TABLE = MDBBLA DDNAME = BILLING KEY OFFSET = 00000 MAX. LRECL = 00563 NBR. VSAM RECORDS READ = 000000342 NUMBER OF RECORDS WRITTEN = 000000342 DB TABLE NAME = BLC, DB TABLE ID = 005, RECORDS WRITTEN = 0000000042 DB TABLE NAME = BLP, DB TABLE ID = 007, RECORDS WRITTEN = 0000000100 DB TABLE NAME = BLO, DB TABLE ID = 006, RECORDS WRITTEN = 0000000200

DBUTLTY JCL

The JOB and JOBLIB statements are for example only. Code these statements according to site standards.
//jobname JOB 'xxxxxxx',CLASS=0,REGION=1000K,MSGCLASS=T //JOBLIB DD DSN=DATACOM.CAILIB,DISP=SHR /* //*-------------------------------------------------------------------* //* EXECUTE DBUTLTY TO INITIALIZE AREA * //*-------------------------------------------------------------------* //INIT EXEC PGM=DBUTLTY //CXX DD DSN=DATACOM.CXX,DISP=SHR //LXX DD DSN=DATACOM.LXX,DISP=SHR //IXX400 DD DSN=DATACOM.DB400.IXX,DISP=SHR //BLA400 DD DSN=DATACOM.DB400.BLA,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSIN DD * INIT AREA=BLA,DBID=400 /* //*-------------------------------------------------------------------* //* EXECUTE DBUTLTY TO LOAD AREA * //*-------------------------------------------------------------------* //LOAD EXEC PGM=DBUTLTY //CXX DD DSN=DATACOM.DB80.CXX,DISP=SHR //LXX DD DSN=DATACOM.DB80.LXX,DISP=SHR //SYSPRINT DD SYSOUT=* //BLADATA DD DSN=DATACOM.BACKUP.DB400.BLA,DISP=OLD //SYSIN DD * LOAD AREA=BLA,DBID=400,FORMAT=BACKUP,DDNAME=BLADATA,SORT=1000 /* //
INIT AREA=BLA,DBID=400
Control statement initializes the data area before loading. Use multiple control statements to initialize multiple areas if converting MDB-related tables to separate areas. Omit this control statement if the area already exists and contains data. In this case, back up the area and concatenate with the output of the Conversion Aid Utility for loading.
LOAD AREA=BLA,DBID=400,FORMAT=BACKUP,DDNAME=BLADATA,SORT=1000
Control statement denotes that the input to the LOAD function of DBUTLTY is a sequential file that is created by the Conversion Aid Utility. (Substitute this format with the correct alternative if loading from a different source.) If you defined the MDB-related tables to separate areas, use multiple LOAD control statements specifying each affected area.