LABEL parameter

The LABEL parameter specifies the data file identifier of the data file on tape used in input and output operations.

The data file can be in either the exchange format or the save/restore format.

Note: The device file commands are used for tapes that are in the exchange format only, not for those in the save/restore format; user-defined device files are not used in save/restore operations.

Each data file on tape has its data file identifier stored in its own file label. The data file label (or header label) of each data file is stored on the tape just before the data in the file. That is, each file on the tape has its own header label and its own data records together as a unit, and one file follows another. In addition to the data file identifier, each label also contains other information about the file, such as the file sequence number, record and block attributes, and whether it is a multivolume data file.

Generally, the data file identifier is an alphanumeric character string that contains no more than 8 characters. However, the maximum length actually depends on several things: what data format is used for the files and CL commands in which the identifiers are specified. The unused portion of the file identifier field should be left blank.

The first character of the data file identifier must be alphabetic (A through Z, $, #, or @) and the rest of the characters should be alphanumeric (A through Z, 0 through 9, $, #, _, ., and @). You can use special characters if the identifier is enclosed in apostrophes. However, if the tape is used on a system other than an iSeries™ system, the requirements for specifying identifiers on that system must be considered.

Tape data file identifiers

Tape data file identifiers can have as many as 17 characters. However, if a tape is used on a system other than an iSeries system, a maximum of 8 characters, or a qualified identifier of no more than 17 characters, should be used. If more than 8 characters are used, the identifier should be qualified and enclosed in apostrophes so that no more than 8 characters occur in either part, and the parts are separated by a period; for example, LABEL('TAXES.JAN1980'). This limitation applies to the following commands: Create Tape File (CRTTAPF), Change Tape File (CHGTAPF), Override Tape File (OVRTAPF), and Display Tape (DSPTAP).

The data file identifier is put on the volume when the data file is put on the volume. For input/output operations, the identifier can be specified in one of tape device file commands, or it can be passed as a parameter when the device file is opened by the high-level language program that uses the file.

Save/Restore format

For tapes in the save/restore format, the identifier can have a maximum of 17 characters. If a library name is used to generate the label, the identifier cannot exceed 10 characters. You may specify a label other than a library name.

Values allowed

One of the following values can be specified for the LABEL parameter, depending upon the command.

*ALL
Labels for all the data file identifiers in the specified tape volumes are shown on the display.
*NONE
The data file identifier is not specified. It must be supplied before the device file (and/or database file) is opened to be used in the tape operation.
*SAME
The data file identifier already present in the tape device file does not change.
data-file-identifier
Specify the identifier of the data file used or displayed with the device file description.
*LIB
The file label is created by the system and the name of the library specified on the LIB parameter is used as the qualifier for the file name.
*SAVLIB
The file label is created by the system, and the name of the library specified on the SAVLIB parameter is used as the qualifier for the file name.