Stacking multiple aggregates on one tape

To stack multiple aggregates onto one tape, copy the files associated with the second backup onto the tape containing the files from the first backup. You can use the sample JCL provided in this topic, to stack additional aggregate backup copies onto the tape by copying the 4 (JCL) steps, and then modifying the ABARS output file name, the volser, and the tape file sequence number.

Step 3: copy ABACKUP Version 2 files onto the tape containing ABACKUP Version 1 files.

Table 1. File sequence after ABACKUP 2 files are copied onto the tape containing ABACKUP 1 files. Tape's volser is A00040.
  File Sequence on tape volser A00040
ABACKUP Version 1:  
Data (D) 1
Other Data (O) 2
Instruction and Activity Log (I) 3
Control (C) 4
ABACKUP Version 2:  
Data (D) 5
Other Data (O) 6
Instruction and Activity Log (I) 7
Control (C) 8

The sample JCL provided in this example, COPYAGGR JCL, stacks the files resulting from the second aggregate backup (ABACKUP Version 2) from the tape volser A00041 onto the tape volser A00040 which contains the files resulting from the first aggregate backup (ABACKUP Version 1). COPYAGGR JCL uses the IEBGENER program to copy the files . IEBGENER is used to copy the aggregate backup files from ABACKUP Version 2 onto the tape containing the aggregate backup files associated with ABACKUP Version 1, uncataloging the original ABACKUP Version 2 files and cataloging the newly copied versions of ABACKUP Version 2. To use COPYAGGR JCL in your environment, modify the aggregate backup file names, volsers, and labeling information that designates the location of the backup files on the tape (presented here in bold text).

Figure 1. Stacking Aggregates - Sample JCL (Part 1 of 2)
///COPYAGGR JOB ,CLASS=A,USER=userid,PASSWORD=pswd,
// MSGCLASS=A
//***************************************************************
//*
//* Job Name: COPYAGGR
//*
//* Function: STACK aggregate backup files onto a single tape.
//* *
//* Description of Process: This is a sample JCL batch job
//* that copies the aggregate backup output files from the
//* second ABACKUP of an aggregate named AGM1 onto the tape
//* where the files from the first ABACKUP of aggregate AGM1
//* reside, thus stacking both aggregate backups onto a single
//* tape.
//*
//* STEP 1, in this job, copies the D file, STEP 2 copies the
//* O file. STEP 3 copies the I file and STEP 4 copies the C
//* file. You will have to update the data set names (ABACKUP
//* files) and the tape volsers in each step in order to run this
//* job in your environment.
//*
//* To copy additional aggregate backups onto the stacked tape,
//* duplicate these 4 steps for each additional aggregate
//* backup and then update the ABACKUP output file (D, O, I or
//* C) names and the file sequence numbers.
//*
//* The job will copy the files from the original ABACKUP tape
//* onto the stacked tape, uncatalog the files from the original
//* tape and catalog the copied version onto the stacked tape.
//*
//* In order to recover any of the aggregates from the stacked
//* tape, use the ABARS ARECOVER command with the XMIT and
//* NOSTACK options specified.
//*
//* Example of ARECOVER command:
//*
//* ARECOVER DSN(control-file-name) XMIT NOSTACK EXECUTE
//*
//***************************************************************
//*
//***************************************************************
//* Copy the D file from the 2nd ABACKUP of aggregate AGM1 onto
//* the same tape containing the output files from the 1st
//* ABACKUP of aggregate AGM1. This D file is copied at file
//* sequence number 5. If the copy is successful uncatalog the
//* original version of the D file and catalog the new stacked
//* version.
//***************************************************************
Figure 2. Stacking Aggregates - Sample JCL (Part 2 of 2)
//*--------------------------------------------------------------
//STEP1 EXEC PGM=IEBGENER
//*--------------------------------------------------------------
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=AGM1.D.C01V0002,DISP=(OLD,UNCATLG,KEEP)
//SYSUT2 DD DSN=AGM1.D.C01V0002,DISP=(NEW,CATLG,DELETE),
// UNIT=3480,LABEL=(5,SL),VOL=SER=A00040,
// DCB=(RECFM=U,LRECL=0,BLKSIZE=32760)
//SYSIN DD DUMMY
/*
//***************************************************************
//* Copy the O file from the 2nd ABACKUP of aggregate AGM1 onto
//* the same tape containing the output files from the 1st
//* ABACKUP of aggregate AGM1. This O file is copied at file
//* sequence number 6. If the copy is successful uncatalog the
//* original version of the O file and catalog the new stacked
//* version.
//***************************************************************
//*--------------------------------------------------------------
//STEP2 EXEC PGM=IEBGENER
//*--------------------------------------------------------------
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=AGM1.O.C01V0002,DISP=(OLD,UNCATLG,KEEP)
//SYSUT2 DD DSN=AGM1.O.C01V0002,DISP=(NEW,CATLG,DELETE),
// UNIT=3480,LABEL=(6,SL),VOL=SER=A00040,
// DCB=(RECFM=U,LRECL=0,BLKSIZE=32760)
//SYSIN DD DUMMY
/*
//***************************************************************
//* Copy the I file from the 2nd ABACKUP of aggregate AGM1 onto
//* the same tape containing the output files from the 1st
//* ABACKUP of aggregate AGM1. This I file is copied at file
//* sequence number 7. If the copy is successful uncatalog the
//* original version of the I file and catalog the new stacked
//* version.
//***************************************************************
//*--------------------------------------------------------------
//STEP3 EXEC PGM=IEBGENER
//*--------------------------------------------------------------
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=AGM1.I.C01V0002,DISP=(OLD,UNCATLG,KEEP)
//SYSUT2 DD DSN=AGM1.I.C01V0002,DISP=(NEW,CATLG,DELETE),
// UNIT=3480,LABEL=(7,SL),VOL=SER=A00040,
// DCB=(RECFM=U,LRECL=0,BLKSIZE=32760)
//SYSIN DD DUMMY
/*
//***************************************************************
//* Copy the C file from the 2nd ABACKUP of aggregate AGM1 onto
//* the same tape containing the output files from the 1st
//* ABACKUP of aggregate AGM1. This C file is copied at file
//* sequence number 8. If the copy is successful uncatalog the
//* original version of the D file and catalog the new stacked
//* version.
//***************************************************************
//*--------------------------------------------------------------
//STEP4 EXEC PGM=IEBGENER
//*--------------------------------------------------------------
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=AGM1.C.C01V0002,DISP=(OLD,UNCATLG,KEEP)
//SYSUT2 DD DSN=AGM1.C.C01V0002,DISP=(NEW,CATLG,DELETE),
// UNIT=3480,LABEL=(8,SL),VOL=SER=A00040,
// DCB=(RECFM=U,LRECL=0,BLKSIZE=32760)
//SYSIN DD DUMMY
//***************************************************************
//* To stack additional versions of the aggregate onto this tape,
//* copy the 4 steps that make up this JCL batch job, then update
//* the ABACKUP (D, O, I and C) file names and the file sequence
//* number.
//***************************************************************
/*