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. For 3590 and higher tape technologies, OPEN routines perform High Speed Positioning by default. This positioning does not rely on block identifiers.

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 will switch 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 will be abnormally terminated. For any label validation errors encountered beyond the 254th data set, the error message does not include the explicit sequence number; instead, it indicates "254+".
  • If you do not specify a sequence number, or if you specify 0, the system assumes that the data set is to be written as the first one 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 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, therefore, processing is 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 (both write a dummy HDR1 label following the VOL1 label). The tape mark is overwritten by the new HDR1 label.
  • When, for multiple data set organizations, the new data set is to be written after the last existing data set on the volume. 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. Duplicate data set names are checked for Version 3 volumes during positioning, as described under Opening an input data set. If a volume is not RACF protected, the accessibility code in the existing HDR1 label of a Version 3 or Version 4 volume is checked before it is overwritten with a new HDR1 label.