Guidelines for templates and tape data sets

When you use the TEMPLATE utility to allocate tape data sets, use the STACK option to control tape processing.

STACK NO specifies traditional, single-file processing. The data set is written, and the tape is rewound and repositioned or even remounted. STACK YES specifies that successive files are to be written on a single logical tape without repositioning or remounting.

When you specify STACK YES, Db2 has the following behavior:

  • Db2 stacks files only within a single utility invocation. When that utility ends, the stack is terminated, which means that the tape is rewound and unloaded. To allow more stacking, use the LISTDEF utility to define a list and then specify that list in another utility control statement. Using a LISTDEF list forces multiple objects to be processed under a single utility invocation.
  • To preserve parallel processing, parallel tasks are written to different tape volumes. The specific volume to which the data set is written can vary, depending on the following factors:
    • The number of output data sets that are being produced
    • The number of parallel processes that are requested
    • The number of tape units that are available to the job step

If you specify STACK YES, take the following actions as needed:

  • To avoid issues with mounting a tape volume on the wrong drive, specify UNCNT 1.
  • To prevent conflicts between parallel processes, use a single process to write a file to a stack. (Parallel processing can complicate stacking.)
  • Ensure that only files of the same type are stacked on the same tape. For example, one tape might contain local primary image copies whereas another tape might contain remote primary image copies. The file types cannot be mixed.
  • Ensure that the number of TEMPLATE utility control statements that specify STACK YES is no more than 85 for one invocation of the utility.
Restrictions: Do not use the STACK YES option in the following situations:
  • For concurrent copies (copies that are made by the COPY utility with the CONCURRENT option)
  • For inline image copies that are created by REORG TABLESPACE on a partition-by-growth base table space with one or more LOB columns
  • Start of changeFor data sets that might be redirected to disk by automatic class selection (ACS) rulesEnd of change
  • Start of changeFL 508For COPYDDN or RECOVERYDDN data sets when running REORG to materialize MOVE TABLE operationsEnd of change

The data sets and utilities for which the STACK YES option are supported are listed in the following table. Yes indicates that the specified utility supports tape stacking for the specified data set. No indicates that the specified utility does not support tape stacking for the specified data set. Ignored indicates that the specified data set does not apply to the specified utility.

Table 1. Supported data sets for tape stacking
ddname CHECK DATA CHECK INDEX or CHECK LOB COPY COPY- TOCOPY LOAD MERGE-COPY REBUILD INDEX REORG INDEX REORG TABLE-SPACE UNLOAD
SYSREC Ignored Ignored Ignored Ignored No Ignored Ignored Ignored Yes Yes
SYSDISC Ignored Ignored Ignored Ignored No Ignored Ignored Ignored Yes Ignored
SYSPUNCH Ignored Ignored Ignored Ignored Ignored Ignored Ignored Ignored Yes Yes
SYSCOPY Ignored Ignored Yes Yes No Yes Ignored Ignored Yes Ignored
SYSCOPY2 Ignored Ignored Yes Yes No Yes Ignored Ignored Yes Ignored
SYSRCPY1 Ignored Ignored Yes Yes No Yes Ignored Ignored Yes Ignored
SYSRCPY2 Ignored Ignored Yes Yes No Yes Ignored Ignored Yes Ignored
SYSUT1 No No Ignored Ignored No Ignored No No No Ignored
SORTOUT No Ignored Ignored Ignored No Ignored Ignored No No Ignored
SYSMAP Ignored Ignored Ignored Ignored No Ignored Ignored Ignored Ignored Ignored
SYSERR No Ignored Ignored Ignored No Ignored Ignored Ignored Ignored Ignored
FILTERDDS Ignored Ignored No Ignored Ignored Ignored Ignored Ignored Ignored Ignored