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:
- Define the MDB-related tables in a MultipleDatacom/DBTable as described in Building Batch MultipleDatacom/DBTables.
- Assemble and Link each MultipleDatacom/DBTable (MDT) for the source VSAM file.
- 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.
- 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.
- 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.
- Verify the accuracy of the resulting Conversion Aid Utility Report. For an example, see Sample DVVMGPR Report (Conversion Aid Utility).
- Initialize the data area by executing theINIT AREAfunction of DBUTLTY.
- Code a control statement for theLOAD AREAfunction of DBUTLTY, specifyingFORMAT=BACKUP.
- Convert the data to that area from the backup file that is created in Step 5 by executing theLOAD AREAfunction of DBUTLTY. For more information, see DBUTLTY JCL.
Rules for Coding Control Statements
Follow these steps:
- Enter an asterisk in column 1 to use the statement for comments.
- Enter keywords and their values between columns 1 and 71. The Conversion Aid Utility terminates processing if any data is found outside this range.
- 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.
- 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.
- 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 theDatacom/DBdatabase ID in which the converted tables will reside. This value should match theDatacom DatadictionaryDATACOM-ID for the DATABASE entity-occurrence.Valid Entries:21—5000Default Value:(No default)
- DDNAME=
- Identifies the DDname of the base cluster that is specified by theDBMDTHDRmacro parameter,DDNAME=for the VSAM data set being converted.Valid Entries:Any valid DDname for the data set being convertedDefault 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, codeINRECFM=F
- If composed of variable-length records, codeINRECFM=V
Valid Entries:F, VDefault Value:(No default) - MDTNM=
- Identifies the name of the MultipleDatacom/DBTable containing conversion criteria for the file being converted. Specify the same name as the one coded for one of the following parameters:
- If defined for batch processing, seeMDTNM=in DBVUFIL Parameter Descriptions.
- If defined for online processing, codeMDTNM=DVMDTPR.
Valid Entries:Load Library member nameDefault Value:(No default) - RKP=
- Indicates the starting position of the prime key relative to zero within the VSAM record of the base cluster referenced byDDNAME=. Use the value coded for one of the following parameters:
- If defined for batch processing, see RKP= in DBVUFIL Parameter Descriptions.
- If defined for online processing, see RKP= in DBVXFIL Parameter Descriptions.
Valid Entries:0 to 32767, but not exceeding the value forVRECDLN=.Default Value:(No default) - VRECDLN=
- Indicates maximum record length. We recommend that you use theVRECDLN=value you assigned for this file in the corresponding VIT or theDatacom Datadictionaryspecification 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 32768Default 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, codeINFILTYP=BKUP.
Valid Entries:VSAM, BKUPDefault 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 theDatacom VSAM TransparencyConversion 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 theREPROfunction of the IDCAMS program.//BKUPFIL DD DSN=DATACOM.VSAM.BLA.REPRO,DISP=OLD
- DCB=(RECFM=VB,LRECL=571,BLKSIZE=4572)
- Code the MDBFILE statement'sDCB=parameter as follows:
- CodeRECFM=VBregardless of whether the record format is variable blocked or fixed blocked.
- Specify a value forLRECLthat is 8 greater than the value specified for the maximum record size in the control statement. (In the sample JCL,LRECL=571while 563 is specified in the control statement.)
- Specify a value forBLKSIZEthat is 4 greater than a multiple ofLRECL. (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.