Skip to content

CMNBKRST - VSAM MASTER UNLOAD, RECOVER, LOAD

Utility program CMNBKRST performs the following three functions the ChangeMan ZMF VSAM package master, component master, and long name component master VSAM KSDS files:

  • Unload (backup) - The records in the VSAM KSDS files are written to separate QSAM files. In each output file, CMNBKRST writes a header record with the date/time that the file is created.

  • Forward Recovery - The records in the three QSAM unload files are written to initialized VSAM KSDS files. Forward recovery records in a sequential copy of the CMNRECV file are written to the appropriate VSAM file if the record time/date is more recent than the QSAM unload file header date/time.

  • Load (restore) - The forward recovery function is executed. However, if no forward recovery records are input to CMNBKRST, or if there are no recovery records that are more recent than the date/time in the QSAM unload file headers, then no forward recovery records are applied, and the operation is effectively a VSAM file load.

Program Execution Parameters

The PARM= statement is always required for program CMNBKRST, and it must have a value. This table describes execution parameters that may be used and the program functions invoked by each.

PARM= Function Description
BACKUP Unload Tells CMNBKRST to perform the unload function
RESTORE Forward recovery Tells CMNBKRST to perform the forward recovery function.
Load Tells CMNBKRST to perform the forward recovery function.
However, if no forward recovery records are input to CMNBKRST, or if there are no recovery records that are more recent than the date/time in the QSAM unload file headers, then no forward recovery records are applied, and the forward recovery is effectively a VSAM file load.

...

CMNBKRST Input and Output

This table shows the inputs and outputs for the three functions performed by CMNBKRST.

PARM= (Function) Input Output
BACKUP (Unload) - Program execution parameter
- VSAM KSDS package master
- VSAM KSDS component master
- VSAM KSDS short name component master
- QSAM unload package master
- QSAM unload component master
- QSAM unload long name component master
- SYSPRINT report
RESTORE (Forward Recovery) - Program execution parameter
- QSAM forward recovery file
- QSAM unload package master
- QSAM unload component master
- QSAM unload long name component master
- VSAM KSDS package master
- VSAM KSDS component master
- VSAM KSDS short name component master
- SYSPRINT report
RESTORE (Load) - Program execution parameter
- QSAM unload package master
- QSAM unload component master
- QSAM unload long name component master
- VSAM KSDS package master
- VSAM KSDS component master
- VSAM KSDS short name component master
- SYSPRINT report

...

Sample JCL

This sample JCL executes the unload (backup) function of CMNBKRST for the package master, the component master, and the long name component master. There is a sample named BACKUP in the distributed CNTL library, step named BACKUP.

//BACKUP  EXEC  PGM=CMNBKRST, *** BACKUP VSAM MASTER FILES
// REGION=4M,
// PARM=BACKUP
//SYSPRINT  DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//CMNPMAST  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNPMAST
//CMNCMPNT  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNCMPNT
//CMNCMPNL  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNCMPNL
//CMNPQSAM  DD  DISP=(,CATLG),
//              DSN=CMNTP.S6.V810.BACKUP.CMNPMAST(+1),
//              UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),
//              DCB=(RECFM=VB,LRECL=5000,BLKSIZE=0)
//CMNCSQSM  DD  DISP=(,CATLG),
//              DSN=CMNTP.S6.V810.BACKUP.CMNCMPNT(+1),
//              UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),
//              DCB=(RECFM=VB,LRECL=5000,BLKSIZE=0)
//CMNCLQSM  DD  DISP=(,CATLG),
//              DSN=CMNTP.S6.V810.BACKUP.CMNCMPNL(+1),
//              UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),
//              DCB=(RECFM=VB,LRECL=5000,BLKSIZE=0)

...

This sample JCL executes the forward recovery or load (restore) function of CMNBKRST for the package master, the component master, and the long name component master.

//BKRST EXEC    PGM=CMNBKRST, *** RESTORE MASTER FILES FROM LATEST
//              REGION=4M,COND=(4,LT), BACKUP AND APPLY CHANGES
//              PARM=RESTORE
//SYSPRINT  DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//CMNPMAST  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNPMAST
//CMNCMPNT  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNCMPNT
//CMNCMPNL  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNCMPNL
//CMNPQSAM  DD  DISP=SHR,DSN=CMNTP.S6.V810.BACKUP.CMNPMAST(0)
//CMNCSQSM  DD  DISP=SHR,DSN=CMNTP.S6.V810.BACKUP.CMNCMPNT(0)
//CMNCLQSM  DD  DISP=SHR,DSN=CMNTP.S6.V810.BACKUP.CMNCMPNL(0)
//CMNRQSAM  DD  DISP=(OLD,DELETE),DSN=&&RECV
//* Add additional recovery datasets from CLEARRCV as needed
//SORTSTAT  DD  SYSOUT=*
//SYSOUT    DD  SYSOUT=*
//SORTWK01  DD  UNIT=SYSDA,SPACE=(CYL,10)
//SORTWK02  DD  UNIT=SYSDA,SPACE=(CYL,10)
//SORTWK03  DD  UNIT=SYSDA,SPACE=(CYL,10)
//SORTWK04  DD  UNIT=SYSDA,SPACE=(CYL,10)

...

DD Statements

This table describes DD statements for CMNBKRST.

DDNAME I/O Purpose
CMNPMAST Package master VSAM KSDS
CMNCMPNT Component master VSAM KSDS
CMNCMPNL Long name component master VSAM KSDS
CMNPQSAM Package master QSAM unload file
CMNCSQSM Component master QSAM unload file
CMNCLQSM Long name component master QSAM unload file
CMNRQSAM Input QSAM copy of forward recovery CMNRECV VSAM file
SYSPRINT Output CMNBKRST record count report

See CMNBKRST Input and Output.

SYSIN Keyword Statements

There are no SYSIN keyword parameters for CMNBKRST.

Return Codes, Completion Codes, and Error Messages

When CMNBKRST encounters a problem:

  • Diagnostic messages are displayed in the SYSPRINT data set.
  • If an error condition would result in a return code of 8 or greater:

    • CMNBKRST forces an abend.
    • The return code is displayed in the USER COMPLETION CODE.
    • This message is displayed on the operator console (WTO): UNACCEPTABLE RETURN CODE - ABEND.

Important

Always check messages in SYSOUT for the CMNBKRST job step, especially if CMNBKRST abends.

This table describes program return codes for CMNBKRST.

Return Code Description
0 Successful execution
4 CMNBKRST finished, but an abnormal condition was encountered; see SYSOUT.
8-16 Fatal error; see SYSPRINT.

...

CMNBKRST issues no numbered messages, so there are no CMNBKRST messages in the ChangeMan ZMF Messages manual.

Reporting

Program CMNBKRST lists record counts in a report at the SYSPRINT DD statement.

Note

Program CMNBKRST lists record counts in a report at the SYSPRINT DD statement.

This is an example of the report when CMNBKRST is run with PARM=BACKUP.

CMNBKRST - EXECUTION BEGINS: 2013/06/01 20:05:55
FUNCTION: BACKUP
INPUT PACKAGE MASTERS:                  0003007
OUTPUT PACKAGE MASTERS:                 0003007
INPUT SHORT NAME COMPONENT MASTERS:     0001134
OUTPUT SHORT NAME COMPONENT MASTERS:    0001134
INPUT LONG NAME COMPONENT MASTERS:      0000000
OUTPUT LONG NAME COMPONENT MASTERS:     0000000
END OF JOB; RC=0000

...

This is an example of the report when CMNBKRST is run with PARM=RESTORE, but no forward recovery records are input.

CMNBKRST - EXECUTION BEGINS: 2013/06/01 20:57:29
FUNCTION: RESTORE
PACKAGE MASTER BACKUP TAKEN:                20130601/20402449
SHORT NAME COMPONENT MASTER BACKUP TAKEN:   20130601/20402449
LONG NAME COMPONENT MASTER BACKUP TAKEN:    20130601/20402449
INPUT RECOVERY RECORDS:                     0000000
INPUT PACKAGE MASTERS:                      0003007
OUTPUT PACKAGE MASTERS:                     0003007
INPUT SHORT NAME COMPONENT MASTERS:         0001134
OUTPUT SHORT NAME COMPONENT MASTERS:        0001134
INPUT LONG NAME COMPONENT MASTERS:          0000000
OUTPUT LONG NAME COMPONENT MASTERS:         0000000
END OF JOB; RC=0000

...

This is an example of the report when CMNBKRST is run with PARM=RESTORE, and forward recovery records are input and applied.

CMNBKRST - EXECUTION BEGINS: 2013/06/01 20:32:05
FUNCTION: RESTORE
PACKAGE MASTER BACKUP TAKEN:                20130601/19535684
SHORT NAME COMPONENT MASTER BACKUP TAKEN:   20130601/19535684
LONG NAME COMPONENT MASTER BACKUP TAKEN:    20130601/19535684
INPUT RECOVERY RECORDS:                     0001169
INPUT PACKAGE MASTERS:                      0002993
OUTPUT PACKAGE MASTERS:                     0003007
PACKAGE RECOVERY RECORDS USED:              0000073
INPUT SHORT NAME COMPONENT MASTERS:         0001130
OUTPUT SHORT NAME COMPONENT MASTERS:        0001134
SHORT NAME CMPNT RECOVERY RECORDS USED:     0000012
INPUT LONG NAME COMPONENT MASTERS:          0000000
OUTPUT LONG NAME COMPONENT MASTERS:         0000000
LONG NAME CMPNT RECOVERY RECORDS USED:      0000000
END OF JOB; RC=0000

...

CMNBKRST Notes

  1. There are situations where you can use IDCAMS in place of CMNBKRST to unload and load the three ChangeMan ZMF VSAM KSDS master files. For example, housekeeping jobs to reorganize the VSAM files can use IDCAMS. However, IDCAMS backups cannot be used for forward recovery, so periodic "backups" of the package master, component master, and long name component master should always use CMNBKRST instead of IDCAMS.

  2. It is important to keep package and component data synchronized, so you should unload, forward recover, and load the three VSAM files as a set.

    However, CMNBKRST skips processing for a file if you code DUMMY in the input and output DD statements for the file. This sample JCL unloads only the long name component master VSAM file.

    //BACKUP  EXEC  PGM=CMNBKRST, *** BACKUP VSAM MASTER FILES
    //              REGION=4M,
    //              PARM=BACKUP
    //SYSPRINT  DD  SYSOUT=*
    //SYSUDUMP  DD  SYSOUT=*
    //CMNPMAST  DD  DUMMY
    //CMNCMPNT  DD  DUMMY
    //CMNCMPNL  DD  DISP=SHR,DSN=CMNTP.S6.V810.CMNZMF.CMNCMPNL
    //CMNPQSAM  DD  DUMMY
    //CMNCSQSM  DD  DUMMY
    //CMNCLQSM  DD  DISP=(,CATLG),
    //              DSN=CMNTP.S6.V810.BACKUP.CMNCMPNL(+1),
    //              UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),
    //              DCB=(RECFM=VB,LRECL=5000,BLKSIZE=0)
    

    ...

  3. When you run CMNBKRST to forward recover a corrupted or lost ZMF VSAM master file, you can input multiple sequential copes of CMNRECV forward recovery files. These files are:

    • Concatenated at DDname CMNRQSAM

    • Input in any order

    • May have overlapping date ranges