Implementing enhanced CDS recovery using JCL

This topic describes the steps necessary to recover a CDS. You can recover a CDS either from the most recent backup copy or from an older backup copy. An older backup copy is needed if your most recent backup copy is unusable. Both types of recoveries are essentially the same except for Step 1 (Create the Backup Journal).

DFSMShsm should be down when processing this procedure.

If multiple journal backup copies are needed to recover the journal, and therefore recover a control data set, the following procedure should be used, because it minimizes the time DFSMShsm is down:

  1. Use the ARCBJRNL utility (with multiple backup copies as input) and the ARCIMPRT utility to recover the control data set to a point just before what the active journal contains.
  2. Bring down DFSMShsm.
  3. Use the ARCBJRNL utility (with only the active journal as input) and the ARCIMPRT utility to finish recovering the control data set. When you run this step you need to make an exported copy of the MCDS created by ARCIMPRT in step 1 as the input to ARCIMPRT in this step.
  4. Bring DFSMShsm up.

Steps 1, 2, and 4 can be run separately as shown or can be combined into one job.

The following sample JCL shows the steps required to recover a control data set:

  1. Create the backup journal.

    The backup journal can be created by using either of the two following JCL examples.

    This example uses only the active journal as input and is used if recovering from the most recent backup copy of your CDS. If the most recent backup copy is a failed copy (last qualifier is Xnnnnnnn), follow the procedures which use an active journal and one or more backup journals.
         //ARCBJRN JOB ,MSGLEVEL=(1,1),MSGCLASS=A,REGION=1024K
         //* -----------------------------------------------------
         //* CREATE DATA SET CONTAINING RECORDS FROM THE
         //* ACTIVE JOURNAL
         //* -----------------------------------------------------
         //STEP01  EXEC PGM=ARCBJRNL
         //STEPLIB   DD DSNAME=location where program ARCBJRNL resides,
         //             DISP=SHR
         //SYSPRINT  DD SYSOUT=*
         //JRNLO     DD DSNAME=online journal data set name,
         //             DISP=OLD
         //JRNLBK    DD DSNAME=backup journal name,
         //             UNIT=unit name,
         //             VOL=SER=volume where backup journal will reside,
         //             SPACE=adequate space to hold journal,
         //             DISP=(,CATLG,DELETE)
     
    Note:
    1. You can indicate what input—the active journal, journal backup copies, or both—is used during ARCBJRNL utility processing by using the PARM keyword on the EXEC statement. The keywords and their meanings are:
      • JRNLONLY — Only the active journal is used as input
      • JRNLBACKUP — Only journal backup data sets are used as input
      • JRNLBACKUPS — Only journal backup data sets are used as input
      • BOTH — Both the active journal and journal backup data sets are used as input
    2. If PARM is not specified, only the active journal is used as input to ARCBJRNL processing.
    3. When using multiple journal backup data sets for input to ARCBJRNL processing, list these data sets in ascending version order in the ARCBJRNL BKUPJRNL DD DSNAME statements.
    4. The following DD statements are required:
      1. JRNLO DD statement pointing to the current online journal being used by DFSMShsm.
      2. BKUPJRNL DD statement pointing to the journal backup copies. If recovering using multiple journal backup copies you must concatenate them in ascending order. In addition if the journal backups were written to tape you must ensure you have enough tape drives available for the number of journal backup copies you will be concatenating as DFSMShsm will allocate all of these data sets at the same time.
      3. JRNLBK dd statement pointing to the merged journal dataset created by ARCBJRNL which will be used as input to step 2. The following example uses the active journal and three existing journal backup copies as input. This example is used if recovering from an older backup copy of your CDS. In this case, the backup CDS is from 4 backups ago.

    The following example uses the active journal and three existing journal backup copies as input. This example is used if recovering from an older backup copy of your CDS. In this case, the backup CDS is from 4 backups ago.

                    //ARCBJRNL JOB ,MSGLEVEL=(1,1),MSGCLASS=A,REGION=1024K
                    //* -----------------------------------------------------
                    //* CREATE DATA SET CONTAINING JOURNAL FROM JOURNAL
                    //* BACKUP COPY DATA SETS AND THE ACTIVE JOURNAL
                    //* -----------------------------------------------------
                    //STEP01    EXEC PGM=ARCBJRNL,PARM='BOTH'
                    //STEPLIB   DD DSNAME=location where program ARCBJRNL resides,
                    //             DISP=SHR
                    //SYSPRINT  DD SYSOUT=*
                    //JRNLO     DD DSNAME=online journal data set name,
                    //             DISP=SHR
                    //BKUPJRNL  DD DSNAME=backup copy name and version,DISP=SHR
                    //          DD DSNAME=backup copy name and version,DISP=SHR
                    //          DD DSNAME=backup copy name and version,DISP=SHR
                    //JRNLBK    DD DSNAME=backup journal name,
                    //             UNIT=unit name,
                    //             VOL=SER=volume where backup journal will reside,
                    //             SPACE=adequate space to hold journal,
                    //             DISP=(,CATLG,DELETE)
     
  2. Sort the journal backup file.
    After you have created the journal backup file using the JCL in step 1, sort the file by KEY using the EQUALS parameter, as in the following JCL.
    Note: The following JCL assumes you have a SORTD cataloged procedure. The SORTD cataloged procedure can be created by running the DFSORT SORTPROC job that DFSORT distributes in SYS1.SAMPLIB. If you do not have a SORTD procedure, modify the EXEC card in the JCL to identify the sort program you want to use. Ensure that the program is logically equivalent to DFSORT.
         //SORT JOB
         //* ----------------------------------------------------
         //* SORT THE BACKED UP JOURNAL
         //* ----------------------------------------------------
         //STEP02  EXEC SORTD
         //SORTLIB   DD .................
         //SYSOUT    DD SYSOUT=*
         //SORTWK01  DD ..........................
         //SORTWK02  DD ..........................
         //SORTWK03  DD ..........................
         //SORTWKnn  DD ..........................
         //SORTIN    DD DSNAME=backup journal name from STEP 1,
         //             DISP=SHR
         //SORTOUT   DD DSNAME=sorted backup journal name,
         //             UNIT=unit name,
         //             VOL=SER=volume where sorted backed up journal will reside,
         //             SPACE=adequate space to hold sorted backed up journal,
         //             DCB=(RECFM=VBS,BLKSIZE=0,LRECL=6560),
         //             DISP=(,CATLG,DELETE)
         //SYSIN     DD *
           SORT  FIELDS=(17,44,CH,A)
                 OPTION EQUALS
         /*
  3. The next step depends on the data mover used to create the backup copy. If the backup copy was made by DFSMShsm, that backup copy is already in the form of a portable exported data set. If this is the case, step 3 is not required.

    If the backup copy has been made by DFSMSdss:

    1. Restore the backup version (either the most recent backup version or the last good backup version) using the following example JCL:
           //JOB1 JOB accounting information,REGION=nnnK
           //STEP1     EXEC  PGM=ADRDSSU
           //SYSPRINT DD SYSOUT=*
           //TAPE      DD    DSN=uid.CDS.BACKUP.D0000106,DISP=(OLD,KEEP)
           //DASD      DD    UNIT=3390,VOL=SER=222222,DISP=OLD
           //SYSIN     DD    *
                       RESTORE DATASET(-
                       INCLUDE(uid.dsname))-
                       INDDNAME(TAPE)-
                       OUTDDNAME(DASD)-
                       REPLACE
           /*
       
    2. Export the data set restored in step 3.a using the following example JCL:
           //EXPORT JOB accounting information,REGION=nnnnK
           //STEP1    EXEC PGM=IDCAMS
           //SYSPRINT DD SYSOUT=*
           //OUTDD1   DD DISP=(,CATLG,DELETE),BUFNO=26,BLKSIZE=28332,
           //         SPACE=(CYL,(200,20),RLSE),
           //         UNIT=3390,VOL=SER=222222,
           //         DSN=temp_dsname
           //SYSIN    DD *
                      EXPORT dsname -
                      OUTFILE(OUTDD1) -
                      TEMPORARY
           /*
       
  4. Import and merge the control data set.

    After you have sorted the journal backup file by doing step 2 and you have an exported copy of the subject CDS, run ARCIMPRT to create a control data set by using the following JCL.

    Note:
    1. If you need to increase the size of the control data set, issue the DEFINE command before the IMPORT command.
    2. Any valid IDCAMS command may be specified in the SYSIN stream. These commands are passed directly to IDCAMS (program ARCIMPRT does not modify these commands). Therefore, the DELETE command is used to delete the control data set before the data set is imported.
    3. The IMPORT command must use the INFILE parameter; using the INDATASET parameter will result in an error return.
    The following sample shows how to re-create a migration control data set. To re-create a backup control data set or an offline control data set, make changes to the "PARM=" in the EXEC statement and to the EXPORT DD statement dsname that reflects which control data set exported copy to use. Also make changes to the OUTDATASET name in the IDCAMS control statement that reflects which control data set is to be re-created.
         //ARCIMPRT JOB
         //* --------------------------------------------------------
         //* RE-CREATE THE MCDS
         //*   Note the parameter in the following execute statement
         //*   specifying which CDS to recover.
         //*   Also, any valid IDCAMS command may be specified in the
         //*   SYSIN stream below.
         //* --------------------------------------------------------
         //STEP03  EXEC PGM=ARCIMPRT,PARM='MCDS'
         //STEPLIB   DD DSNAME=where ARCIMPRT resides,
         //             DISP=SHR
         //SYSPRINT  DD SYSOUT=*
         //AMSDUMP   DD SYSOUT=*
         //JOURNAL   DD DSNAME=name of sorted backup journal from STEP 2,
         //             DISP=SHR
         //EXPORT    DD DSNAME=name of portable exported MCDS from STEP 3,
         //             DISP=SHR
         //SYSIN     DD *
           DELETE (MCDS cluster name) CLUSTER PURGE
           IMPORT INFILE(EXPORT) OUTDATASET(MCDS cluster name)
         /*
     
  5. Restart DFSMShsm from the processing unit from which you issued ARCIMPRT.
  6. Verify that the control data sets are correct. See Determining if control data sets are accurate.
  7. Fix any errors in the control data sets. See Repairing errors in the control data sets.
  8. If you are recovering the MCDS, issue a QUERY CDSVERSIONBACKUP to ensure that the latest final qualifier is correct. You can determine the final qualifier of the latest backup copy from your catalog using the LISTCAT LEVEL command, as shown in the following example:
    LISTCAT LEVEL(uid) 
    If these qualifiers do not match, use the FIXCDS patch command to correct the field at offset X'B1' in the MHCR record to reflect the latest version in the catalog, as shown in the following example:
    FIXCDS S MHCR PATCH(X'B1' 0000007)
  9. Use the CONTROLDATASETS parameter of the BACKVOL command to get a current backup copy of the control data sets and journal data set.
  10. Restart DFSMShsm in the other processing units.