Cleanup after stacking errors

If a problem occurs during the stacking procedure, you must uncatalog the ABACKUP files associated with the bad aggregate version on the stacked tape, and recatalog the files on the original backup tape to avoid loss of data. The example described in End of volume during the stacking process shows the EOV error that occurred during the writing of the O file. In the sample COPYAGGR JCL, described in Stacking multiple aggregates on one tape, the D file is copied first, followed by the O file, the I file, and the C file. After the EOV error, version 2 of the aggregate AGM1 has all of the D file, and part of the O file on the stacked tape volser (A00040). The I file and the C file are on the original tape volser (A00041). To recover the data associated with version 2 of the aggregate AGM1 or attempt to stack this version onto a new tape, you must:

  1. Uncatalog the D file and the O file that reside on the stacked tape A00040.
  2. Recatalog the D file and the O file onto their original tape A00041.

This example shows a sample JCL that you can use to recatalog an entire aggregate onto the original ABACKUP file. This JCL recatalogs all of the ABACKUP files associated with version 2 of aggregate AGM1 onto the original ABACKUP volser.

Figure 1. Sample JCL to recatalog an entire aggregate onto the original ABACKUP file
//DEFNVSAM JOB ,CLASS=A,USER=userid,PASSWORD=pswd,
// MSGCLASS=A
//******************************************************************
//* *
//* Job Name: DEFNVSAM *
//* *
//* Function: Use this job to catalog the ABACKUP output files, *
//* onto their original tape volser, when an error occurs during *
//* the IEBGENER stacking JCL job. *
//* *
//* Before running this job, make sure the ABACKUP files, *
//* associated with the failed aggregate copy, are uncataloged. *
//* *
//******************************************************************
//*
//*----------------------------------------------------------------
//STEP0001 EXEC PGM=IDCAMS Catalog D file
//*----------------------------------------------------------------
//SYSPRINT DD SYSOUT=A
//SYSABEND DD DUMMY
//SYSIN DD *
DEFINE NONVSAM -
(NAME(AGM1.D.C01V0002) -
DEVICETYPES(3480) -
FILESEQUENCENUMBERS(1) -
VOLUMES(A00041)) -
CATALOG(HSMLIBC.USERCAT)
/*
//*----------------------------------------------------------------
//STEP0002 EXEC PGM=IDCAMS Catalog O file
//*----------------------------------------------------------------
//SYSPRINT DD SYSOUT=A
//SYSABEND DD DUMMY
//SYSIN DD *
DEFINE NONVSAM -
(NAME(AGM1.O.C01V0002) -
DEVICETYPES(3480) -
FILESEQUENCENUMBERS(2) -
VOLUMES(A00041)) -
CATALOG(HSMLIBC.USERCAT)
/*
//*----------------------------------------------------------------
//STEP0003 EXEC PGM=IDCAMS Catalog I file
//*----------------------------------------------------------------
//SYSPRINT DD SYSOUT=A
//SYSABEND DD DUMMY
//SYSIN DD *
DEFINE NONVSAM -
(NAME(AGM1.I.C01V0002) -
DEVICETYPES(3480) -
FILESEQUENCENUMBERS(3) -
VOLUMES(A00041)) -
CATALOG(HSMLIBC.USERCAT)
/*
//*----------------------------------------------------------------
//STEP0004 EXEC PGM=IDCAMS Catalog C file
//*----------------------------------------------------------------
//SYSPRINT DD SYSOUT=A
//SYSABEND DD DUMMY
//SYSIN DD *
DEFINE NONVSAM -
(NAME(AGM1.C.C01V0002) -
DEVICETYPES(3480) -
FILESEQUENCENUMBERS(4) -
VOLUMES(A00041)) -
CATALOG(HSMLIBC.USERCAT)