Positioning the volume to the data set

After the volume is mounted and verified, the system positions the tape to receive the new data set. Usually the new data set is the first and only data set on the tape, so the tape remains positioned immediately following the VOL1 label. DFSMSrmm provides support for high-speed positioning for data sets other than the first data set. The OPEN routine provides the block identifier, and DFSMSrmm saves it in its control data set and supplies it back to OPEN on any subsequent request to the data set.

To create a data set that follows another data set already stored on the tape, you specify a data set sequence number in the LABEL parameter of the DD statement.
  • The sequence number can be from 1 to 65535, with 1 representing the first data set on the volume. If the volume ends with EOV labels before the specified sequence number, the open routine switches to the next volume. If you specify a sequence number that is greater than the number of data sets existing on the volume, plus one, your task is abnormally terminated.
  • If you do not specify a sequence number, or specify zero, the system assumes that the data set is to be written as the first on the volume.

To position the tape, the system maintains a logical data set sequence number in the UCB. The method of positioning is the same as that previously explained for opening an input data set.

Only one data set on a tape volume can be open at any given time. Processing is abnormally terminated if you attempt to open another data set on the same volume.

When the tape is positioned to receive the new data set, the system expects to find either an existing HDR1 label or a tape mark. If neither is present, the system assumes that other data is recorded where the HDR1 label should be, and processing is therefore abnormally terminated. If the last data set on a tape has EOV labels, another data set cannot be written to follow it.

If a tape mark is found, it indicates that a HDR1 label does not exist at the position at which the new data set is to be written. The system bypasses all further label verification and accepts the tape for output. The conditions under which the system finds a tape mark instead of a HDR1 label are:
  • When a tape mark immediately follows the VOL1 label. This can occur when the tape is initialized by means other than the EDGINERS or IEHINITT utility programs (EDGINERS and IEHINITT write a dummy HDR1 label following the VOL1 label). The tape mark is overwritten by the new HDR1 label.
  • When the new data set is to be written after the last existing data set on the volume (for multiple data set organizations). In this case, the system encounters the second tape mark following the existing EOF trailer label group. The tape mark is overwritten by the new HDR1 label.

If the system finds an existing HDR1 label, it checks the label to determine whether the existing data set can be overlaid.