How to build a VRECOVER that recovers all volumes from a previous VBACKUP with VOLUMES=ABC/
For volume backups we can use wild carding to select volumes, for example:
SCAN REALVOLS,SHOWVOL
SELECT VOLUMES=ABC/
VBACKUP RETPD=03
Wild cards are not supported like below:
SCAN REALVOLS,SHOWVOL
VRECOVER VOLUMES=ABC/,RPT=MAP,GOAHEAD=CONTINUE
Release: Diskā¢ Backup and Restore
As a work around, the following LISTD/SORT sample JCL can be used. It has wild card work around. The VBACKUP creates a special DSNINDEX record for each volume backed up. It contains the volser in the data set name field of the DSNINDEX record: DMSOS.Vxxxxxx
So this lists all volume backups by a LISTD DSN=DMSOS.V/,FIELDS=(DSNAM,ARCDT,ATIME)
From this report, for example all ABC/ volumes can be generated as shown below: The corresponding VRECOVER commands via SORT:
/*-------------------------------------------------------------------
//LISTD EXEC LISTD
//SYSPRINT DD DSN=ABC.LISTD.OUT,
// DISP=(NEW,CATLG),UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=133,BLKSIZE=0)
//SYSIN DD *
LISTD DSN=dataset./,
FIELDS=(DSNAM,ARCDT,ATIME)
//*-------------------------------------------------------------------
//SORT EXEC PGM=SORT,REGION=5M
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABC.LISTD.OUT,DISP=SHR
//SORTOUT DD DSN=ABC.LISTD.CMDS,
// DISP=(NEW,CATLG),UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=4000)
//SORTIN DD *
SORT FIELDS=COPY
*SELECT VBACKUP DSINDEX RECORDS
INCLUDE COND=(02,7,CH,EQ,C'dataset',
*SELECT ALL ABC/ VOLUMES AND,09,3,CH,EQ,C'ABC')
*GENERATE VRECOVER COMMAND
OUTREC FIELDS=(C' VRECOVER VOLUMES=',9,6,C',GOAHEAD=CONTINUE',80:X)
//*-------------------------------------------------------------------