Copies of lists of objects from tape

The COPYTOCOPY utility determines the number of tape drives to use for the function.

If you use JCL to define tape drives, the JCL allocates tape drives for those definitions. If you use TEMPLATES to allocate tape drives for the output data sets, the utility dynamically allocates the tape drives according to the following algorithm:

  • One tape drive if the input data set resides on tape.
  • A tape drive for each template with STACK YES that references tape.
  • Three tape drives, one for each of the local and remote output image copies, in case non-stacked templates reference tape.

Thus, COPYTOCOPY allocates a minimum of three tape drives. The utility allocates four tape drives if the input data set resides on tape, and more tape drives if you specified tape templates with STACK YES.

If input data sets to be copied are stacked on tape and output data sets are defined by a template, the utility sorts the list of objects by the file sequence numbers (FSN) of the input data sets and processes the objects serially.

Image copies of compressed indexes are copied in uncompressed format, so if you perform COPYTOCOPY using those image copies as input, it will result in uncompressed image copies.

For example, image copies of the following table spaces with their FSNs are stacked on TAPE1:

  • Db2.TS1 FSN=1
  • Db2.TS2 FSN=2
  • Db2.TS3 FSN=3
  • Db2.TS4 FSN=4

In the following statements, COPYTOCOPY uses a template for the output data set:

//COPYTOCOPY  EXEC DSNUPROC,SYSTEM=V71A  
//SYSIN    DD *   
TEMPLATE A1 &DB..&SP..COPY1 TAPE UNIT CART STACK YES
            COPYTOCOPY
            TABLESPACE DB1.TS4
                 LASTFULL
                 RECOVERYDDN(A1)
            TABLESPACE DB1.TS1
                 LASTFULL
                   RECOVERYDDN(A1)
            TABLESPACE DB1.TS2
                 LASTFULL
                 RECOVERYDDN(A1)
             TABLESPACE DB1.TS3
                 LASTFULL
                 RECOVERYDDN(A1)

As a result, the utility sorts the objects by FSN and processes them in the following order:

  • DB1.TS1
  • DB1.TS2
  • DB1.TS3
  • DB1.TS4

If the output data sets are defined by JCL, the utility gives stacking preference to the output data sets over input data sets. If the input data sets are not stacked, the utility sorts the objects by size in descending order.