LABEL parameter

The LABEL parameter specifies the data file identifier of the data file (on diskette or tape) used in input and/or 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 diskettes and 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 that is on a diskette or tape has its data file identifier stored in its own file label.

On diskette, all of the data file labels are in one place, in the volume label area of that diskette. In addition to the data file identifier, each label contains other information about the file, such as where the file is stored on the diskette (track and sector) and whether the file continues on another diskette (in the case of a multivolume data file).

On tape, 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, whether the files are on diskette or on tape, 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 @). Use special characters if the identifier is enclosed in apostrophes. However, if the diskette or tape is used on a system other than an iSeries 400, the requirements for specifying identifiers on that system must be considered.

Diskette and tape data file identifiers

For diskettes in the exchange format, the data file identifier cannot exceed 8 characters (the same limit as for RPG file names). This limitation applies to the following commands: Create Diskette File (CRTDKTF), Change Diskette File (CHGDKTF), Change Spooled File Attributes (CHGSPLFA), Override Diskette File (OVRDKTF), Delete Diskette Label (DLTDKTLBL), Display Diskette (DSPDKT), and Start Diskette Reader (STRDKTRDR).

For tapes, the identifier can have as many as 17 characters. However, if a tape is used on a system other than an iSeries 400, 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).

Duplicate data file identifiers are not allowed in the same volume, on either diskette or tape. However, the identifier can be the same as the name of the database file written to diskette or tape if the file name contains no more than 8 characters. The diskette and tape data files contain only data, not file descriptions like those of database files. On diskette, the identifiers ERRORSET and SYSAREA cannot be used; they are reserved for special use.

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 the diskette or 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 diskettes in the save/restore format, the data file identifier can have a maximum of 17 characters. If a library name is used to generate the label, the file identifier can have a maximum of 15 characters. The identifier consists of a library name of up to 10 characters followed by a period, a Q, and a 3-digit sequence number; for example, LABEL('PAYLIB.Q014'). The 15-character limit applies to identifiers of save/restore data files displayed by the DSPDKT command.

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 diskette or 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 diskette or tape operation.

*SAME: The data file identifier already present in the diskette or tape device file does not change.

data-file-identifier: Specify the identifier of the data file (on diskette or tape) 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.