z/OS DFSMS Using Magnetic Tapes
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Positioning the volume to the data set

z/OS DFSMS Using Magnetic Tapes
SC23-6858-00

When the tape is accepted for input, the system positions the tape at the first record of the data set to be processed. Usually there is only one data set on the volume and positioning is set to the first record on the tape.

To retrieve a data set when there are more than one on a single volume of tape, specify a data set sequence number in the LABEL parameter of the DD statement, unless the data set is cataloged. You need not specify a data set sequence number for a cataloged data set, because the number can be obtained from the catalog along with the volume serial number.
  • The sequence number can be from 1 to 65535, with 1 representing the first data set on the volume. If you specify a sequence number higher than the number of data sets on the volume, then OPEN spaces the tape through and removes it from the volume or receives an I/O error.
  • If you do not specify a data set sequence number or specify a zero, and the data set is not cataloged, then the system assumes that the data set is first in sequence on the volume.
  • The first data set on an unlabeled tape is not normally preceded by a tape mark. If a tape mark precedes the first data set, the sequence number of that data set is two. The effect is as if a data set containing no data preceded the tape mark. Alternately you can use the LTM option described in Leading tape marks.

To position the tape, the system uses the requested data set sequence number in the JFCB and maintains a logical data set sequence number in the UCB. The number in the UCB represents the current position of the tape and is maintained as follows:

  1. When a tape is first mounted, the data set sequence number in the UCB is 0.
  2. When a data set is opened, the open routine sets the data set sequence number in the UCB to 1. If the tape is still positioned from previous processing, such as for a LEAVE request, the open routine does not reset the number in the UCB. This means that multiple volume, multiple data set NL tape, unlike SL tape, requires a different JCL data set sequence number, unless the tape stays mounted.
  3. The data set sequence number in the UCB is compared to the requested data set sequence number in the JFCB. If they are equal, the tape is already positioned at the requested data set. If they are not equal, the open routine adjusts the data set sequence number in the UCB as the tape is positioned past each data set until the number in the UCB equals the number in the JFCB.
  4. To position to a data set when there are multiple data sets on multiple volumes, specify the volume serial numbers of the volumes on which the data set resides in the VOLUME parameter of the DD statement and the data set sequence number in the LABEL parameter. You are not required to specify the volume serial number or the data set sequence number for a cataloged data set.
  5. When multiple tape units are used and a volume switch causes processing to be continued on a volume on a different unit, the EOV routine copies the data set sequence number from the previous UCB to the current UCB.

No more than one data set on a tape volume can be open at a time. Processing is abnormally terminated if you attempt to begin processing a second data set on the same volume.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014