All examples in this section are found in the JCL library installed with FDR. The member names are EX6013x.
Copy FDR or DSF backup example
Copy an FDR or DSF backup data set. UNIT= and VOL=SER= are specified, but if the input backup was cataloged, they could be omitted; in that case the backup could be on tape or DASD. If the backup occupied multiple tape volumes, VOL=SER=(vol1,vol2,…) would be specified. Since COPYDSN=YES is NOT specified, the data set name on the TAPEOUT DD statement are used. TAPEOUT specifies a volume count in case more than five output tape volumes are required.
//FDRTCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TAPEIN DD DSN=FDR.BACKUP,DISP=OLD,
// UNIT=TAPE,VOL=SER=B00023
//TAPEOUT DD DSN=FDR.COPY,UNIT=TAPE,
// DISP=(NEW,KEEP),VOL=(,,,255)
//SYSIN DD *
COPY
/*
Copy ABR backup creating two copies example
Copy an ABR-created incremental backup tape, creating one copy that replaces the original, and a second copy that is cataloged as a COPY2. ABRCOPY2=FLIP requests that the data sets on TAPE2OUT have their copy numbers “flipped”, in this case from COPY1 to COPY2. CAT=RECAT and CAT2=RECAT is assumed so the COPY1 files replace the original files in the catalog, and the COPY2 files are cataloged. EXP=JCL is assumed, but since there is no expiration or retention specified in the JCL, the original expiration dates of the input files are copied to the output tapes. The first backup to be copied is located through the ABR catalog, since UNIT= and VOL= are not specified. Since ALLFILES is specified, all of the backups on the tape set, starting with the specified backup, are copied. If the backups extended to multiple tape volumes, FDRTCOPY locates the additional volumes through the ABR catalog and automatically calls for them to be mounted.
//FDRTCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TAPEIN DD DSN=FDRABR.VSYSRES.C1000101,DISP=OLD
//TAPEOUT DD DSN=DUMM1,UNIT=3590,VOL=(,,,255),DISP=(NEW,KEEP)
//TAPE2OUT DD DSN=DUMM2,UNIT=3590,VOL=(,,,255),DISP=(NEW,KEEP)
//SYSIN DD *
COPY ALLFILES,ABRCOPY2=FLIP
/
Copy an ABR archive tape example
Copy a multi-volume ABR archive tape (that is probably also multi-file), creating a “COPY1” from a “COPY2” tape, and update the ABR Archive Control File (archived data sets cannot be easily restored from archive tapes unless the Archive Control File is updated). ABRCOPY=FLIP causes the copy number in the input file to be changed from “2” to “1”. RETPD=90 causes the expiration date of the output file, in the tape labels, the Archive Control File, and the tape management system (if any) to be set to 90 days from today. The ARCHIVE DD statement specifies the Archive Control File to be updated. Even though multiple volumes are to be copied, only the first volume serial needs to be specified on the TAPEIN DD statement; in most cases, FDRTCOPY can locate the other volumes required from the ABR catalog.
//FDRTCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//ARCHIVE DD DSN=FDRABR.ARCHIVE,DISP=SHR
//TAPEIN DD DSN=FDRABR.VTSO001.B296120A,UNIT=CART,
// VOL=SER=A00021,DISP=(OLD,KEEP)
//TAPEOUT DD DSN=DUMM1,UNIT=TAPE,RETPD=90,
// DISP=(NEW,KEEP),VOL=(,,,255)
//SYSIN DD *
COPY ALLFILES,ABRCOPY=FLIP
/*
Recreate a damaged ABR tape example
An ABR tape (backup or archive) has been damaged or lost, so its duplicate copy is copied to recreate it. Even though only one volume of a multi-volume backup is damaged it is easiest to recreate the entire set of volumes. ABRCOPY=FLIP causes the copy number to “flip” from the good copy to that of the copy being replaced. EXP=JCL is assumed but since no expiration is specified it copies the expiration date from the input files. This example shows reading a COPY2 archive to recreate a COPY1, but the input could be COPY1 or could be a backup. By default, the Archive Control File is updated to point to the new copy, if the input is an archive tape.
//FDRTCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TAPEIN DD DSN=FDRABR.VTSO001.B290020A,DISP=(OLD,KEEP),
// UNIT=TAPE,VOL=SER=A00079
//TAPEOUT DD DSN=DUMM1,UNIT=TAPE,DISP=(NEW,KEEP),VOL=(,,,99)
//SYSIN DD *
COPY ALLFILES,ABRCOPY=FLIP
/*
Copy backup ON DASD to tape example
Copy a sequential DASD FDR backup file to tape. The DISP= parameters shown causes the DASD file to be deleted and the tape copy to be cataloged if the copy is successful.
//FDRTCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TAPEIN DD DSN=FDR.BACKUP.VPROD03,DISP=(OLD,DELETE,KEEP)
//TAPEOUT DD DSN=FDR.BACKUP.VPROD03,UNIT=TAPE,
// DISP=(NEW,CATLG,KEEP)
//SYSIN DD *
COPY
/*
Automated copy of ABR tapes example
FDRTCOPY requires that the full data set name of the first data set to be copied be provided. The naming convention for ABR-created backup data sets causes the data set names to change with every ABR run, so a daily FDRTCOPY job would need to be manually updated every day. The following example is a technique to automate the copying of these tapes and avoid having to manually update JCL for each run.
FDRTCOPY can copy a file that was not created by FDR or ABR as long as it is empty, containing no records. These empty files are copied but are not cataloged, and do not generate an error. You can create an empty file of a known name as the first file on the ABR tape, using IEBGENER, and use that name in the FDRTCOPY JCL. In this example, the dummy file is a GDG, so the appropriate GDG index must be created beforehand; a non-GDG could also be used.
Important
- If ABR begins over on a new scratch tape (as after an abend of a backup task, or if the MAXFILES= value is reached) the files created after that point are NOT included in the copy created by FDRTCOPY.
- FDRTSEL, described in FDRTSEL Introduction, can also be used to automate copying of ABR tapes, without creating dummy files or modifying your ABR jobs.
Changes to the backup job
//* CREATE A DUMMY DATA SET AS FIRST FILE ON TAPE
//*
//DUMMYFIL EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DUMMY,DCB=(RECFM=FB,BLKSIZE=80)
//SYSUT2 DD DSN=FDRABR.DUMMY.BKUP(+1),
// UNIT=TAPE,DISP=(,CATLG),VOL=(,RETAIN)
//*
//* DO AN ABR BACKUP, STARTING AT SECOND FILE
//*
//ABRSTEP EXEC PGM=FDRABR
//TAPE1 DD DSN=FDRABR.DUMMY1,VOL=REF=*.DUMMYFIL.SYSUT2,
// LABEL=2,DISP=(,KEEP)
//*
//* (REMAINDER OF ABR JOB STEP)
Changes to the FDRTCOPY job
//* COPY CURRENT BACKUPS RELATE TO THE DUMMY CATALOGED DATA SET
//*
//TCOPY EXEC PGM=FDRTCOPY,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//TAPEIN DD DISP=OLD,DSN=FDRABR.DUMMY.BKUP(0)
//TAPEOUT DD DSN=DUMM1,UNIT=TAPE,
// DISP=(NEW,KEEP),VOL=(,,,99)
//SYSIN DD *
COPY ALLFILES,ABRCOPY=2
/*