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


Sample jobs for scenario two are:

  • Delete Roots from SHISAM by IMS DL/I Delete (DLET) call
//CARSOND  JOB A,'NONAME',MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,            
//         NOTIFY=&SYSUID                                               
//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        GHU   CARSON  (TSAI     =MEGA22)                               
L        DLET                                                           
L        GU    CARSON  (TSAI     =MEGA11)                               
L        GN                                                             
L        GN 
  • Result after IMS DLI calls from prior step (Note: Two Roots exist: MEGA111 AND MEGA333)
   TIMINGS THIS GU   CALL:          DL/I TASK TIME(OS TTIMER)=        .000,0   CLOC
CALL=GU       SEG=CARSON    FIELD=TSAI      OPER= =      VALUE=MEGA11)          
                                                                                
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     =(MEGA333 TEST DATA TEST DATA                                       
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                                                                  
             (                        )                                         
                                                                                
DBPCB   LEV=01  SEG=CARSON    RET CODE=    KFDB LEN=0006  KEY FDB=(MEGA33) 


  • Read VSAM KSDS by DITTO (Note: Two Records exist)
  Process   View   Options   Help                                               
................................................................................
 DITTO/ESA for MVS              VB - VSAM Browse                                
                                                                                
 CATALOG                                                                        
 RBA 24576        Key MEGA11                           Col 1        Format CHAR 
 VOLSER Z17DL1   Type KSDS   DSNAME IMS9.IVPDB7                                 
                                                                                
 RBA        Len     <===5>..10....5...20....5...30....5...40....5...50....5...60
 24576      1024    MEGA111 TEST DATA TEST DATA                                 
 25600      1024    MEGA333 TEST DATA TEST DATA                                 
 ****  End of data  **** 

Sample jobs for scenario three are:

  • Insert data with DFSDDLT0 and issue an extended checkpoint (or symbolic checkpoint) to update log with data then abend
//SYSIN   DD *                                                          
.---+----1----+----2----+----3----+----4----+----5----+----6----+----7--
O SNAP= ,ABORT=0                                                        
S 1 1 1 1 11  4       2                                                 
L        XRST                                                           
L        DATA                                                           
L        ISRT  CARSON                                                   
L        DATA  MEGA888 TEST DATA TEST DATA                              
L        ISRT  CARSON                                                   
L        DATA  MEGA999 TEST DATA TEST DATA                              
L        CHKP                                                           
L        DATA  CKPT1                                                    
L        ISRT  CARSON                                                   
L        DATA  MEGAAAA TEST DATA TES	T DATA                              
L        ISRT  CARSON                                                   
L        DATA  MEGABBB TEST DATA TEST DATA                              
ABEND
  • Output of above Job log, CKPTID is recorded, and then job abended with U0252
+DFS0540I  *EXTENDED CHECKPOINT* PROGRAM=DFSDDLT0,CKPTID=CKPT1   ,REGID=0001
+DFS0542I  *EXTENDED CHECKPOINT* DAY=115,TIME=140157695428+0000 IMXX 
  • Data retrieved from VSAM KSDS by DITTO after U0252 ABEND (uncommitted data has been backed out by IMS after abend)
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 MEGA333 TEST DATA TEST DATA                                              
00003 MEGA444 TEST DATA TEST DATA                                              
00004 MEGA555 TEST DATA TEST DATA                                              
00005 MEGA666 TEST DATA TEST DATA                                              
00006 MEGA777 TEST DATA TEST DATA                                              
00007 MEGA888 TEST DATA TEST DATA                                              
00008 MEGA999 TEST DATA TEST DATA                                              
00009 ****  End of data  **** 
  • Run restart job (DFSDDLT0) with XRST call by providing checkpoint id(CKPT1)
  • For IMS Batch Messaging Processing (BMP), specify CKPTID=LAST of the PARM= parameter on the EXEC statement
//SYSIN   DD *                                                          
.---+----1----+----2----+----3----+----4----+----5----+----6----+----7--
O SNAP= ,ABORT=0                                                        
S 1 1 1 1 11  4       2                                                 
L        XRST                                                           
L        DATA  CKPT1                                                    
L      8 DATA  OVERLAY2 
  • Job output of the restart job with XRST call
$HASP373 CARSOND  STARTED - INIT 1    - CLASS A - SYS Z170                     
IEF403I CARSOND - STARTED - TIME=14.16.15                                      
+DFS0540I *XRST IN PROGRESS    * PROGRAM=DFSDDLT0,CKPTID=CKPT1   ,REGID=0001,DA
-                                         --TIMINGS (MINS.)--            ----PA
-JOBNAME  STEPNAME PROCSTEP    RC   EXCP    CPU    SRB  CLOCK   SERV  PG   PAGE
-CARSOND  BMP      G           00    101    .00    .00    .00    203   0      0
IEF404I CARSOND - ENDED - TIME=14.16.15 

................................................................................
TIMINGS THIS XRST CALL:          DL/I TASK TIME(OS TTIMER)=        .001,0   CLOC
CALL=XRST                                                                       
                                                                                
SEGMENT     =(CKPT1                                                   )         
                                                                                
IOPCB         LTERM=          RET CODE=    RACFUSER=DFSIVP7S.                   
................................................................................
TIMINGS THIS XRST CALL:          DL/I TASK TIME(OS TTIMER)=        .000,0   CLOC
CALL=XRST                                                                       
                                                                                
   NO SEGMENT RETURNED.                                                         
                                                                                
DBPCB   LEV=01  SEG=CARSON    RET CODE=    KFDB LEN=0006  KEY FDB=(MEGA99)    

You can see that the job was restarted properly from last completed checkpoint.

You can exploit CKPT/XRST function to restart an ABEND batch job automatically after migrating to SHISAM from KSDS file.

Step 3: Perform Minimum Application Changes to Convert VSAM-Based Ap-plication to IMS DL/I Batch Application

The old VSAM-based application needs to be changed. You can also convert the old appli-cation to BMP application. Minimum VSAM-based application changes needed include:

  1. Remove the following statements from the old application
    OPEN  (UCAT1,INPUT)
          	CLOSE (UCAT1,,PRINT,,ERROR) 
    and
    UCAT1    DCB   DSORG=PS,DDNAME=UCAT1,MACRF=GM,LRECL=133,EODAD=RETURN  
    	  PRINT    DCB   DSORG=PS,DDNAME=PRINT,MACRF=PM                         
    ERROR    DCB   DSORG=PS,DDNAME=ERROR,MACRF=PM
  2. Change “GET UCAT1,DATAREC1” to IMS ASMTDLI interface with GU call. The DATAREC1 is IOAREA in the GU call.
  3. Change “PUT PRINT,DATAREC2” to IMS ASMTDLI interface with Insert (ISRT) call. The DATAREC2 is IOAREA in the ISRT call.
  4. Prepare the DSECT of I/O Program Communication Block (IOPCB) and Database Program Communication Block (DBPCB).
  5. Data Availability Needed

    In today's 24-7 business environment, data availability for VSAM files is important. Mi-grating the VSAM files to IMS increases the data availability for online access and data can be shared by multiple IMS batch jobs for parallel processing. This can be done with the minimum application changes.

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