9 Min reading time

IMS Database Modernization: Faster Backups and Reorgs

25. 11. 2026
Overview

This IMS database modernization project cut backup time for 120 GB from two hours to 15 minutes. The team also sped up reorganizations, simplified transfers to Db2, and automated transaction restarts.

For one mainframe team, IMS database modernization started with a backup that took two hours for just 120 GB. Rejuvenating the existing system meant improving database performance and giving operators fewer jobs to release by hand.

IBM IMS usually has a reputation for being old and complex, but reliable and fast, and it kind of makes sense, and people usually accept that without any kind of questioning since you can’t have it all. Usually, everyone treats it as a powerful beast, meaning “don’t touch it unless you absolutely have to, and be glad that it’s on our side”.

There was a customer recently that fits this description to a tee. They’re not a very big shop, having only hundred or so databases and a few thousand transactions and PSBs, and they have only a 12×5 availability requirement (just like in the good old days). Their internal atmosphere around IMS is “we’re living with it as it was set up 40 years ago and that’s fine because it doesn’t support any new features”. That’s because they unfortunately didn’t have anyone to tell them that an old dog can learn a lot of new tricks.

IMS database modernization: cutting backup time to 15 minutes

Their biggest pain point was the speed and the complexity of IMS backups. They lasted for 2 hours (which for 120 GB of DB data is a bit too long) and were set up in such a way that adding a new database to the backup list was almost a separate implementation project. Running ad-hoc backups of certain databases before critical batch processing was also out of the question due to the complexity of the setup.

The old backup procedure was set up using GENJCL.IC and GENJCL.USER with heavy customizations of the templates, and it generated 16 JCL jobs (with 1-55 steps each), which computer operators released from hold manually based on their personal judgement.

Fortunately, here IBM IMS High Performance tooling comes to rescue. A nifty tool in the HP tool pack is the High Performance Image Copy program, which allows for both simplified syntax and faster execution than normal out-of-the-box image copy utility. If you have compression enabled for your IMS databases, compression and decompression routines will be run on zIIP where eligible, which is a lifesaver. A sample execution JCL is shown below:

//K01     EXEC PGM=FABJMAIN
//STEPLIB  DD  DISP=SHR,DSN=IMSTOOLS.COMBLOAD
//         DD  DISP=SHR,DSN=IMSP.SDFSRESL
//DFSRESLB DD  DISP=SHR,DSN=IMSP.SDFSRESL
//IMS      DD  DISP=SHR,DSN=IMSP.DBDLIB
//IMSDALIB DD  DISP=SHR,DSN=IMSP.MDALIB
//PRIMAPRT DD  SYSOUT=*
//STATIPRT DD  SYSOUT=*
//VALIDPRT DD  SYSOUT=*
//EVALUPRT DD  SYSOUT=*
//SUMMARY  DD  SYSOUT=*
//DFSPRINT DD  SYSOUT=*
//ICEPRINT DD  SYSOUT=*
//ICEIN    DD  *
  GLOBAL HDPC=Y,
         DBALL=Y,
         ZIIPMODE=COND,
         DEL_ICDS=Y,
         ICNMRULE=Y,
         ICHLQ=IMSIC1P,
         DSN=&ICHLQ..D.&DBD..&DDN..D&SYEAR.&MONTH.&DAY..T&TIME.,
         SPACE=(CYL,320,100,RLSE),
         UNIT=3390,
         VOLCNT=30,
         ICOUT=*,
         STORCLAS=RCVDC1,
         DATACLAS=EXTENDED,
         MGMTCLAS=RCVDC,
         RETPD=22
   GROUP FUNC=AIC,
         CAGRP=CAGR01
/*

This sample is copied as-is from the live environment and it shows how easy it is to make a backup of an entire CA group with simple statement. A lot of these allocation parameters, such as UNIT, VOLCNT, STORCLAS, MGMTCLAS, DATACLAS could be omitted if SMS ACS routines already assign these. A good thing about HPIC is that it allows for easy checking of database integrity with HDPC=Y statement, which will invoke HD Pointer Checker without any extra hassle.

We first tried HPIC using its’ “compatibility” interface, meaning that it acted as a stand-in replacement for DFSUDMP0 without any changes to JCL (except changing STEPLIB DD), and performance gains were already visible there with the elapsed time reduction from 120 minutes to 60-ish minutes, but the true performance gain was achieved when we let HPIC do its’ magic by telling it to backup all databases in our master CA group and let it arrange and decide the order of each IC. Using the JCL sample above, we cut down our execution time from 120 minutes to 15 minutes. We almost couldn’t believe the savings, and were ready to raise a support ticket to say not everything was backed up… That’s how good it is.

Improving IMS database performance during reorganizations

After everyone heard of the “impossible” gains that we got with HPIC, we turned our attention to other high-performance tooling in the toolbox, to see what else can be simplified and optimized.

One of the “forbidden phrases” at the same site was telling the IMS sysprogs and DBAs that an IMS database needs a REORG. This always turned out to be a whole weekend ordeal, with downtime announcements, panic about needing extra backups at every step, and waiting for several hours for the unload and load to be completed and hoping that they don’t ABEND for whatever reason in the middle of the process.

Here, the trio of HP Unload, HP Load and Index Builder tooling comes to rescue. These tools allow for simplified syntax, and through some kind of black magic, provide as much as 10x savings in elapsed time (in our case). We suspect that it’s due to Media Manager interfaces, but you can never be too sure.

One nifty feature of HP Load and Index Builder is automatically running IDCAMS DELETE and DEFINE CLUSTER commands instead of having additional steps in JCL jobs. The only “caveat” is that the commands must be in a PDS (which is specified under DDEFPDS), and the member must have the same name as the DDNAME of the database data set. The sample job that we use as a template is shown below.

//RO$dbname$   JOB (M0000),
// CLASS=6,
// MSGCLASS=X,
// NOTIFY=&SYSUID.,
// REGION=0M,
// COND=(4,LT)
//****************************************************************
//DELDS    EXEC PGM=IEFBR14
//SYSUT2    DD  DSN=IMSUL1P.D.$dbname$,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(CYL,(1),RLSE)
//HPSRSIDX  DD  DSN=IMSUL1P.D.$dbname$.HPSRSIDX,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(CYL,(1),RLSE)
//****************************************************************
//HPIC     EXEC PGM=FABJMAIN
//STEPLIB   DD  DSN=IMSP.EXITLIB,
// DISP=SHR
//          DD  DSN=IMSTLS.COMBLOAD,
// DISP=SHR
//          DD  DSN=IMSP.SDFSRESL,
// DISP=SHR
//DFSRESLB  DD  DSN=IMSP.SDFSRESL,
// DISP=SHR
//IMS       DD  DSN=IMSP.DBDLIB,
// DISP=SHR
//IMSDALIB  DD  DSN=IMSP.MDALIB,
// DISP=SHR
//PRIMAPRT  DD  SYSOUT=*
//STATIPRT  DD  SYSOUT=*
//VALIDPRT  DD  SYSOUT=*
//EVALUPRT  DD  SYSOUT=*
//SNAPPIT   DD  SYSOUT=*
//SUMMARY   DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//DFSPRINT  DD  SYSOUT=*
//ICEPRINT  DD  SYSOUT=*
//ICEIN     DD  *
  GLOBAL HDPC=Y,
         DBALL=Y,
         DBRC=Y,
         DBDALLOC=Y,
         ICDALLOC=Y,
         DATA_MOVER=ADRDSSU,
         ZIIPMODE=COND,
         DEL_ICDS=Y,
         ICCAT=Y,
         ICNMRULE=Y,
         ICHLQ=IMSIC1P,
         DSN=&ICHLQ..D.&DBD..&DDN..D&SYEAR.&MONTH.&DAY..T&TIME.,
         SPACE=(CYL,320,100,RLSE),
         UNIT=3390,
         VOLCNT=30,
         DATACLAS=EXTENDED,
         STORCLAS=SCIMSIC,
         MGMTCLAS=MCIMSIC1,
         RETPD=22,
         ICOUT=*
 AIC     DBD=$dbname$
/*
//*********************************************************************
//HPUNLOAD EXEC PROC=FABHULU,
// DBD=$dbname$,
// MBR=FABHURG1
//SYSUT2    DD  DSN=IMSUL1P.D.$dbname$,
// DISP=(NEW,CATLG,DELETE),
// DCB=BUFNO=100,
// DSNTYPE=LARGE,
// SPACE=(CYL,(10000,4000),RLSE)
//HSSROPT   DD  *
HPIO YES
ZIIPMODE COND
/*
//*********************************************************************
//HPLOAD   EXEC PGM=HPSRRC00,
// PARM=(ULU,DFSURGL0,$dbname$,7,0000,,0,,N,0,T,,,Y,Y,JRLM,Y,,,'',,,,N,
//       ,,,'')
//STEPLIB   DD  DSN=IMSP.EXITLIB,
// DISP=SHR
//          DD  DSN=IMSTLS.COMBLOAD,
// DISP=SHR
//          DD  DSN=IMSP.SDFSRESL,
// DISP=SHR
//IMSDALIB  DD  DSN=IMSP.MDALIB,
// DISP=SHR
//IMS       DD  DSN=IMSP.DBDLIB,
// DISP=SHR
//PROCLIB   DD  DSN=IMSP.PROCLIB,
// DISP=SHR
//DDEFPDS   DD  DSN=IMSAPLP.PARMLIB,
// DISP=SHR
//DFSUINPT  DD  DSN=IMSUL1P.D.$dbname$,
// DISP=SHR
//HPSRSIDX  DD  DSN=IMSUL1P.D.$dbname$.HPSRSIDX,
// DISP=(NEW,CATLG,DELETE),
// DCB=BUFNO=100,
// DSNTYPE=LARGE,
// SPACE=(CYL,(4000,1000),RLSE)
//SYSPRINT  DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//DFSVSAMP  DD  DSN=IMSP.PROCLIB(DFSVSMHP),
// DISP=SHR
//FRRIN     DD  *
HPIO=YES
ZIIPMODE=COND
/*
//*********************************************************************
//HPIDXBLD EXEC PGM=IIUSTART
//STEPLIB   DD  DSN=IMSP.EXITLIB,
// DISP=SHR
//          DD  DSN=IMSTLS.COMBLOAD,
// DISP=SHR
//          DD  DSN=IMSP.SDFSRESL,
// DISP=SHR
//IMSDALIB  DD  DSN=IMSP.MDALIB,
// DISP=SHR
//IMS       DD  DSN=IMSP.DBDLIB,
// DISP=SHR
//IIUPRINT  DD  SYSOUT=*
//IIUCAPT   DD  SYSOUT=*
//IIUSNAP   DD  SYSOUT=*
//IIUSOUT   DD  SYSOUT=*
//DDEFPDS   DD  DSN=IMSAPLP.PARMLIB,
// DISP=SHR
//HPSRSIDX  DD  DSN=IMSUL1P.D.$dbname$.HPSRSIDX,
// DISP=SHR
//IIUIN     DD *,SYMBOLS=EXECSYS
  INPUT    IBSCAN,DBRC=Y
  PROC     BLD_ALL,$dbname$
  ZIIPMODE COND
  SORTOPT  ZSORT
  CLASS    &SYSUID..IMSIXBLD
/*
//*********************************************************************
//HPIC     EXEC PGM=FABJMAIN
//STEPLIB   DD  DSN=IMSP.EXITLIB,
// DISP=SHR
//          DD  DSN=IMSTLS.COMBLOAD,
// DISP=SHR
//          DD  DSN=IMSP.SDFSRESL,
// DISP=SHR
//DFSRESLB  DD  DISP=SHR,DSN=IMSP.SDFSRESL
//IMS       DD  DISP=SHR,DSN=IMSP.DBDLIB
//IMSDALIB  DD  DISP=SHR,DSN=IMSP.MDALIB
//PRIMAPRT  DD  SYSOUT=*
//STATIPRT  DD  SYSOUT=*
//VALIDPRT  DD  SYSOUT=*
//EVALUPRT  DD  SYSOUT=*
//SNAPPIT   DD  SYSOUT=*
//SUMMARY   DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//DFSPRINT  DD  SYSOUT=*
//ICEPRINT  DD  SYSOUT=*
//ICEIN     DD  *
  GLOBAL HDPC=Y,
         DBALL=Y,
         DBRC=Y,
         DBDALLOC=Y,
         ICDALLOC=Y,
         DATA_MOVER=ADRDSSU,
         ZIIPMODE=COND,
         DEL_ICDS=Y,
         ICCAT=Y,
         ICNMRULE=Y,
         ICHLQ=IMSIC1P,
         DSN=&ICHLQ..D.&DBD..&DDN..D&SYEAR.&MONTH.&DAY..T&TIME.,
         SPACE=(CYL,320,100,RLSE),
         UNIT=3390,
         VOLCNT=30,
         DATACLAS=EXTENDED,
         STORCLAS=SCIMSIC,
         MGMTCLAS=MCIMSIC1,
         RETPD=22,
         ICOUT=*
 AIC     DBD=$dbname$
/*
//*********************************************************************
//DELDS    EXEC PGM=IEFBR14
//SYSUT2    DD  DSN=IMSUL1P.D.$dbname$,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(CYL,(1),RLSE)
//HPSRSIDX  DD  DSN=IMSUL1P.D.$dbname$.HPSRSIDX,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(CYL,(1),RLSE)

The sample job is fairly straightforward and contains 7 steps:

  1. Delete any existing unload files
  2. Run HPIC to make a back up in case of any errors
  3. Run the HP Unload
  4. Run the HP Load
  5. Run the Index Builder
  6. Make a new IC, just in case
  7. Delete any remaining work files

Moving IMS data to Db2 with HP Unload

After reading up on HPU documentation, it came to light that it supports various unload formats, unlike regular DFSURGU0. One of these formats is the *F3 format that provides a full concatenated key for each unloaded segment, which allows for resorting the file and feeding the input to other programs and utilities such as Db2 LOAD utility. Business users jumped on that opportunity to use it for transferring IMS data to Db2 without worrying about writing custom COBOL and PL/I programs to parse the regular (*HD) output into something more digestible for Db2 LOAD.

Automating IMS transaction restarts with an HLASM exit

Last year at GS UK Conference, Mr Kevin Stewart from IBM held a marvelous presentation called “Implementing IMS Exits”. Before this presentation, a deeply held belief in our team was that any exit whose source code is not fully provided and supported by IBM is something to be avoided like the plague. After all, “exits are complicated”, “impossible to debug”, “even harder to write”, and they should be avoided at all costs, especially because someone must maintain them across versions of the product they are supplementing. Mr Stewart’s presentation was a true eye-opener because it showed that our long-standing problem with manually restarting failed transactions can be avoided by a simple “no-logic” exit, as shown below.

DFSCONE0 CSECT
DFSCONE0 AMODE 31
DFSCONE0 RMODE ANY
         USING DFSCONE0,R15
         B     AROUND
         DC    C'OUR EYE-CATCHER'
AROUND   DS    0H
         LA    R15,X'00'           CLEANUP CONV, DISCARD RESP MSG & SPA
         BR    R14

This exit basically does nothing except return an RC of 0, and it’s all we needed to implement “auto-restartable” transactions. This simple exit reduced operators’ workload by 70-ish percent, by their own words.

Get in touch

If you have any questions, we are one click away.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Contact us

Schedule a call with an expert