Switching data set backup tapes

When you specify a value other than zero for SETSYS DSBACKUP(TAPE(DEMOUNTDELAY(MAXIDLETASKS(n)))), the data set backup function may allow output tapes to be continuously mounted for an indefinite amount of time. There may be times when you want or need to demount the tapes. You can use the SWITCHTAPES keyword and parameters to demount a continuously mounted tape. You may want to do so, for example, so that it or an alternate can be taken to another site for disaster backup, or so that you can install new tape devices. The SWITCHTAPES keyword is available on both the DEFINE and HOLD commands.

Note: If you specify the MARKFULL parameter of the DEFINE SWITCHTAPES(DSBACKUP) command, the tapes that are released from command data set backup are marked full. However, other partial tapes in the data set backup inventory (previous partial tapes) remain as selection candidates. These partial tapes may be immediately selected and mounted for output processing.

DEFINE SWITCHTAPES tells DFSMShsm that, at specific times or events, you want the data set backup function to automatically demount and deallocate all currently mounted tapes and allocated drives. HOLD(BACKUP(DSCOMMAND)) tells DFSMShsm that you want to immediately quiesce data set backup activity to tape, demount all mounted tapes, and deallocate all tape devices. Therefore, if you plan ahead, you can use the DEFINE command to switch tapes. For unplanned activity, use the HOLD command to switch tapes.

Note: A tape can remain continuously mounted for a long period of time because both new tape technologies and a steady stream of data set backup requests allow an increased amount of data on the tape. It can also be mounted for a long time because the MAXIDLETASKS and DEMOUNTDELAY parameters on the SETSYS DSBACKUP command specify that tapes can be continuously mounted while inactive.
The DEFINE SWITCHTAPES(DSBACKUP) command allows you to choose among the following parameters:
TIME
Indicates that you want to define a time when DFSMShsm initiates the demount and deallocation of all mounted tapes, performed at a certain time of day.
AUTOBACKUPEND
Indicates that you want DFSMShsm to initiate the demount and deallocation of all mounted tapes at the end of the autobackup cycle.
PARTIALTAPE
Indicates the method that DFSMShsm uses to mark an output tape as full. This is an optional keyword. MARKFULL, REUSE, and SETSYS are all valid options. SETSYS indicates that you want DFSMShsm to use the SETSYS PARTIALTAPE value.

The HOLD BACKUP(DSCOMMAND(SWITCHTAPES)) command tells DFSMShsm to perform SWITCHTAPES processing now; that is, to demount and to deallocate drives. DFSMShsm demounts active tapes at the end of the current data set, but immediately demounts idle tapes. The demounted tapes are marked full or not, according to the existing PARTIALTAPE parameter of the DEFINE SWITCHTAPES command. No subsequent RELEASE command is necessary. After these tapes are demounted and the drives are deallocated, data set backup continues with newly selected tapes, if requests are present.

Related reading

For more information about the exact syntax of the DEFINE and HOLD commands, see DEFINE command: Defining control structures for use by DFSMShsm and the HOLD command: Preventing DFSMShsm functions from running.