Verifying data set name

To ensure that the correct data set is being opened, the system compares the data set name in the HDR1 label to the data set name specified by the user in the DD statement. This comparison is made on only the 17 least significant (rightmost) nonblank characters of the data set name (including 8 characters for the generation and version numbers if the data set is part of a generation data group). DFSMSrmm checks the full 44-character data set name if the previous data set name information is known to DFSMSrmm.

The comparison is made on only the last (rightmost) 17 nonblank characters of the data set name shown in the HDR1 label. It is a good practice, therefore, to limit tape data set names to 17 characters or fewer, when unique names are required, as for password-protected data sets.

For Version 1 HDR1 labels, the generation and version numbers of a generation data set are included in the file identifier and thus are included in the characters compared by the system; however, for Version 3 or Version 4 HDR1 labels, they are not included in the file identifier. For generation data sets with Version 3 or Version 4 labels, the generation and version numbers do not participate in password protection.

For tapes with Version 3 or Version 4 labels, during positioning, the file identifier in each HDR1 label encountered is also checked against duplicate names for the requested data set. The duplicate name check occurs only from the volume position at the time of OPEN until the destination position. For example, if a volume is positioned at the end of data set X at position 5 on the volume as a result of a previous CLOSE LEAVE request, and you request that a data set Y be opened at position 6, no duplicate name check will occur because the volume is already at the desired position. You can force a subsequent duplicate name check from the beginning of the volume by using the CLOSE REWIND option.

If a request is for the first data set on a volume, the volume is always rewound to load point, and no duplicate name search occurs.

You can force a duplicate name check from the first volume of a multivolume aggregate by specifying a volume sequence number of 1 (VOL=(PRIVATE,,1)) along with a cataloged data set request or along with serial numbers specified. During the search, the message IEC140I START OF DATASET NOT ON VOLUME occurs for each volume mounted on which the requested data set is not found.

Because the suffix of a generation data set is not included in the file identifier of a Version 3 or Version 4 HDR1 label, duplicate name checking prohibits maintaining members of the same generation data group on a volume unless label validation has been suppressed.

If a duplicate name is encountered for a Version 3 label, the label validation exit is entered.

Note: If you inadvertently specify an incorrect file sequence number for a data set, and the data set is encountered before the number specified, the exit is entered with a "duplicate name error" condition. If the exit accepts the error, an abend can result when the target data set does not match the requested data set name.