Retrieve Tape Labels (QTARTLBL) API

  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Tape Labels (QTARTLBL) API retrieves the label information for the files on a tape cartridge. This API provides a function similar to the Display Tape (DSPTAP) command.

Authorities and Locks

Device Description Authority
*USE

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable that receives the information requested. You can specify the size of the area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided. The length of receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of receiver variable parameter specified is larger than the allocated size of the receiver variable specified in the user program, the results are not predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)

The content and format of the information being returned.

The RLBL0100 format must be used for the label information. See RLBL0100 Format to view the information returned for this format.

Device description
INPUT; CHAR(10)

The name of the tape device or tape library device containing the cartridge for which the label information is to be returned.

Request qualifiers
INPUT; CHAR(*)

The request qualifiers specify which cartridge to use, what labels to return, and what action to perform after the label information is retrieved. The following table shows the information that can be specified. Default values are used for any fields that are not specified. For more details about the fields in the following table, see Field Descriptions.



Length of request qualifiers
INPUT; BINARY(4)

The length, in bytes, of the Request qualifiers provided. The following values are allowed:



Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


RLBL0100 Format

The following table shows the information that is returned for the RLBL0100 format. For more details about the fields in the following table, see Field Descriptions.



Label information

The label information. Each label information entry has the following format. For more details about the fields in the following table, see Field Descriptions.



For more information regarding IBM® standard volume labels and data set labels 1 and 2, select the appropriate topic below:

Field Descriptions

Additional label entries. Indicates if there were labels on tape that were not returned because the return data would have exceeded 16,000,000 Bytes. The following values can be returned:

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned.

Cartridge ID. The cartridge identifier for the media. This field will be blanks if the device is not a tape library device.

Code. The encoding used for the data on tape. The following values can be returned:

Density. The density that is used for the data on the tape.

Device name. The tape device or tape library device that was used.

Ending file sequence number. The ending sequence number for which the labels are to be retrieved. When a numeric value is specified it must be left justified and padded with blanks on the right. The ending sequence number can not be less than the starting file sequence number. The following special values are supported:

End option. The operation to perform on the tape volume after the retrieve completes. The following special values are supported:

Label 1. The contents of the first trailer label for the file sequence.

Label 2. The contents of the second trailer label for the file sequence.

Leading tape mark. Indicates if the tape was a leading tape mark tape. The following values can be returned:

Length of label information entry. When label information is available this field is set to the length, in bytes, of a single label information entry. A value of zero is returned if the tape is not a standard labeled tape, if there are no labels on the tape, or if the receiver variable is not large enough to hold any label information entries.

Logical block ID. The logical block identifier for the file sequence.

Multi-volume sequence number. The sequence number for the tape volume.

Number of label information entries. If there is room in the receiver variable for 1 or more complete label information entries, this value is set to the number of complete label information entries returned. The Bytes returned value can be used to determine if any partial label information entries were returned.

If there is room in the receiver variable for only part of the first label information entry, this value is set to 1 and it will be necessary to use the Bytes returned value to determine which label information fields are valid.

A value of zero is returned if the tape is not a standard labeled tape, if there are no labels on the tape, or if the receiver variable is not large enough to hold any label information entries.

Note: A maximum of 72,726 entries can be returned.

Offset to label information. The offset, in bytes, to the label information. A value of zero is returned if the tape is not a standard labeled tape, if there are no labels on the tape, or if the receiver variable is not large enough to hold any label information.

Requested file label. The data file label that is to be retrieved. The data file label is a maximum of 17 characters in length and is case sensitive. The following special value is supported:

Note: When a specific file label is requested, the label information will only be returned for the first file found that matches the requested file label.

Requested volume identifier. The tape volume for which the labels are to be retrieved. For a tape library device this field should be set to a cartridge identifier to be mounted and used. The following special value is supported:

Reserved. An ignored field. This field is set to hexadecimal zeros for output fields and must be set to hexadecimal zeros for input fields.

S/36 File type. The System/36™ file type for the file sequence. The following file types can be returned:


Sequence number. The file sequence number.

Standard label. Indicates if the tape was a standard labeled tape. The following values can be returned:

Starting file sequence number. The starting sequence number for which the labels are to be retrieved. When a numeric value is specified it must be left justified and padded with blanks on the right. The following special values are supported:

Volume label. The volume label read from the tape. This field is set to blanks for a non-labeled tape.


Error Messages



API introduced: V5R3

[ Back to top | Backup and Recovery APIs | APIs by category ]