You are currently on IBM Systems Media’s archival website. Click here to view our new website.

MAINFRAME > Administrator > IMS

DIY: Migrating VSAM files to IMS Database


Many IBM customers are still using a lot of VSAM files in production. Migrating VSAM-based applications to an IMS database can provide applications with the ability to exploit the IMS functions for high availability. This migration can be performed with minimum applica-tion changes.

This article includes instructions and samples on how to migrate the VSAM in Key-Sequenced Data Set (KSDS) to IMS simple hierarchical indexed sequential access method (SHISAM) database.

Step 1: Add IMS Stage 1 Definitions

First, new Database Description (DBD) definition and Program Specification Block (PSB) definition are added in IMS stage 1 for the VSAM KSDS. For the DBD definition, make sure that BYTES of the root segment for SHISAM is the logical record length in VSAM. New data-base macro statement(s) should also be added for the user to have the online access (see Figure 1).

Step 2: Simulate the Migration Using DFSDDLT0 and DITTO Utility to Verify the Definition From Step 1, if Needed

IMS Data Language/I (DL/I) test program (DFSDDLT0) can be used to simulate IMS data-base access, and IBM Data Interfile Transfer, Testing and Operations Utility for ESA (DITTO) can be used to simulate VSAM file access by batch job. Three test scenarios include:

  1. Updating VSAM in KSDS with DITTO to simulate current batch job access, and retrieve the data change with DFSDDLT0 using IMS DL/I calls
  2. Issuing IMS DL/I calls to insert/delete data, then using DITTO to read the data change to simulate the batch job accessing VSAM file
  3. Seeing if the batch job can be restarted properly with an IMS extended restart (XRST) call once the VSAM in KSDS is migrated to the IMS

Sample jobs for scenario one are:

  • The VSAM KSDS data set
DSLIST - Data Sets Matching IMS9.IVPDB7                             Row 1 of 3 
 Command ===>                                                  Scroll ===> CSR  
                                                                                
 Command - Enter "/" to select action                  Message           Volume 
 -------------------------------------------------------------------------------
          IMS9.IVPDB7                                                    *VSAM* 
          IMS9.IMSDB7.INDX                                               Z17DL1 
          IMS9.IVPDB7.DATA                                               Z17DL1 
 ***************************** End of Data Set list ****************************
  • Read VSAM KSDS by DITTO (The file is empty to start with.)
   Process   View   Options   Help                                             
................................................................................
 DITTO/ESA for MVS               VE - VSAM Edit                                 
                                                                                
 CATALOG                                                                        
 DSNAME IMS9.IVPDB7                                  Col 1          Format CHAR 
 VOLSER Z17DL1  Type KSDS                            Insert length 1024         
       <===5>..10....5...20....5...30....5...40....5...50....5...60....5...70...
 00000 ****  Top of data  ****                                                  
 00001 ****  End of data  **** 
  • Add new record (in red) into VSAM KSDS by DITTO
   Process   View   Options   Help                                               
................................................................................
 DITTO/ESA for MVS               VE - VSAM Edit                                 
                                                                                
 CATALOG                                                                        
 DSNAME IMS9.IVPDB7                                  Col 1          Format CHAR 
 VOLSER Z17DL1  Type KSDS                            Insert length 1024         
       <===5>..10....5...20....5...30....5...40....5...50....5...60....5...70...
 00000 ****  Top of data  ****                                                  
 00001 MEGA111 TEST DATA TEST DATA                                              
 00002 MEGA222 TEST DATA TEST DATA                                              
 00003 MEGA333 TEST DATA TEST DATA                                              
 00004 ****  End of data  **** 
  • Read IMS SHISAM by DL/I Get Next (GN) calls
//CARSOND  JOB A,'NONAME',MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,            
//         NOTIFY=&SYSUID                                               
//********************************************************************* 
//*  BMP JOB TO RUN FOR DFSDDLTO                                        
//********************************************************************* 
//BMP     EXEC IMSBATCH,MBR=DFSDDLT0,PSB=DFSIVP7S,                      
//             NBA=20,OBA=30,DIRCA=50,IMSID=IMXX                        
//PRINTDD DD SYSOUT=*                                                   
//IMS     DD DISP=SHR,DSN=IMS9.PSBLIB                                   
//        DD DISP=SHR,DSN=IMS9.DBDLIB                                   
//PUNCHDD DD SYSOUT=*                                                   
//SYSIN   DD *                                                          
.---+----1----+----2----+----3----+----4----+----5----+----6----+----7--
O SNAP= ,ABORT=0                                                        
S 1 1 1 1 11  4       2                                                 
L        GN                                                             
L        GN                                                             
L        GN                                                             
L        GN 
  • Display the result of DLI GN calls (three Roots exist)
   TIMINGS THIS GN   CALL:          DL/I TASK TIME(OS TTIMER)=        .000,1   CLOC
CALL=GN                                                                         
                                                                                
SEGMENT     =(MEGA111 TEST DATA TEST DATA                                       
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                        )                                         
                                                                                
DBPCB   LEV=01  SEG=CARSON    RET CODE=    KFDB LEN=0006  KEY FDB=(MEGA11) 


   TIMINGS THIS GN   CALL:          DL/I TASK TIME(OS TTIMER)=        .000,0   CLOC
CALL=GN                                                                         
                                                                                
SEGMENT     =(MEGA222 TEST DATA TEST DATA                                       
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                        )                                         
                                                                                
DBPCB   LEV=01  SEG=CARSON    RET CODE=    KFDB LEN=0006  KEY FDB=(MEGA22) 
   TIMINGS THIS GN   CALL:          DL/I TASK TIME(OS TTIMER)=        .000,0   CLOC
CALL=GN                                                                         
                                                                                
SEGMENT     =(MEGA333 TEST DATA TEST DATA                                       
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                        )                                         
                                                                                
DBPCB   LEV=01  SEG=CARSON    RET CODE=    KFDB LEN=0006  KEY FDB=(MEGA33) 
   TIMINGS THIS GN   CALL:          DL/I TASK TIME(OS TTIMER)=        .000,0   CLOC
CALL=GN                                                                         
                                                                                
   NO SEGMENT RETURNED.                                                         
                                                                                
DBPCB   LEV=00  SEG=          RET CODE=GB  KFDB LEN=0000   

Carson Tsai is a senior IT specialist with IBM.

Rita Shih is an IMS quality analyst with IBM.

Jack Yuan is a senior software engineer for IMS development. He can be contacted at jackyuan@us.ibm.com



Like what you just read? To receive technical tips and articles directly in your inbox twice per month, sign up for the EXTRA e-newsletter here.



Advertisement

Advertisement

2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

Bringing IMS and SOA Together With IMS Connect

New requirements for IMS Connect functionality could make implementing an SOA environment with IMS easier and more flexible.

Celebrating 40 Successful Years

IMS version 10 supports synchronous and asynchronous callout

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
Mainframe News Sign Up Today! Past News Letters