Specify tape device file parameters

Read this information to understand the parameters for the Create Tape File (CRTTAPF), Change Tape File (CHGTAPF), and Override with Tape File (OVRTAPF) commands.

The description of the tape device file record is in the application program that uses the tape information. The system views each record as one field with a length equal to the record length.

The following section lists considerations for parameters that are specified on the CRTTAPF, CHGTAPF, and OVRTAPF commands.
DEV
The name of the device description for a tape device file that identifies the devices the file can access.
VOL
The volume identifiers of the tapes that are used for the device file can be specified using the VOL parameter on the CRTTAPF, CHGTAPF, and OVRTAPF commands. The volume identifiers may contain from 1 to 6 alphanumeric characters.
REELS
The REELS parameter specifies both the number of tapes that will contain the data file, and the type of label processing that is used by those tapes. Ignore the reel number during output processing or specifying a volume list. Ignore the reel number if you specify standard label processing (by using *SL on the REELS parameter).

If some of the file labels are incorrect, specify bypass label processing (*BLP). The system will check each reel for a volume label that begins with the characters VOL1. The system will ignore most other volume label information and the file labels on the tape.

For bypass label processing, each data file on the tape must contain a header label and either an end-of-file trailer label or an end-of-volume trailer label.

SEQNBR
The SEQNBR parameter specifies the sequence number of the data file on tape. The data files are numbered consecutively across all the volumes they occupy, starting with sequence number 1 for the first data file on the first volume. (Valid values for the sequence number range from 1 to 16 777 215.) Figure 1 shows how to number files for labeled volumes that contain more than one file and contain multivolume tapes (FILEB on three volumes):
Figure 1. Data file sequence number on multivolume tapes
This graphic depicts 3 volumes.
The first volume has two files. File A, which contains sequence number 1 and
file B, which contains sequence number 2. The second volume has one file,
File B which contains sequence number 2. The third volume contains two files.
Those two files are File B, which contains sequence number 2 and file c which
contains sequence number 3.

The sequence number specified for new standard labeled data files on tape must correspond to the physical sequence number of data files on the tape. (Specify the sequence number by the SEQNBR parameter on the CRTTAPF, CHGTAPF, and OVRTAPF commands.) This means that if files 1 and 2 exist on the tape, the next data file created must have a sequence number of 3. To create a new data file on a tape that contains the last volume of a multivolume-tape data file, the sequence number of the new data file must be the sequence number of the last data file on the multivolume tape data file plus 1. In Figure 1, the sequence number of FILEC must be 3, even though there are only two files on the last volume.

Always specify the location of a data file on tape with the SEQNBR parameter. The information specified on the LABEL parameter verifies that you found the correct data file. However, this verification only occurs after the system locates the file that is specified with the SEQNBR parameter. You cannot locate a data file on tape by label name. If you use the Check Tape (CHKTAP) command, the sequence number of the data file returns in the completion message.

You can use some special values in place of an actual sequence number:

  • *NEXT: The system processes the next sequential data file on the tape. If you position the tape before the first data file, the system processes the first data file on the tape. *NEXT is useful for applications that need to read all data files on a tape. The system uses this value for tape device files that are used to read from tape. The system issues an error message when you use a tape device file to write to a tape and you specify *NEXT.
  • *END: The system writes the data file to the end of the tape. The system uses this value in tape device files that are used to write to tape. The system issues an error message when you use a tape device file to read from a tape and you specify *END.

The SEQNBR parameter for an output file for which EXTEND(*NO) is specified must be one of the following values:

  • SEQNBR(1). This overwrites the first data file on the volume, regardless of the sequence number in the labels of the first data file already on the volume.
  • A value of 1 greater than the value for a data file that already exists on the volume. This either overwrites an existing data file on the volume or adds a data file at the end of the volume.
    Note: If the tape device is a 1/4-inch or 8-mm cartridge device, the program will not overwrite the existing files.
  • *END.
LABEL
The LABEL parameter specifies the data file label on the tape.

The information specified on the LABEL parameter is used for new labels created for an output file for which EXTEND(*NO) is specified. It is also used for an I/O file for which EXTEND(*YES) is specified to verify that the correct file is processed.

FILETYPE
The file type of the file to process. The value should be *DATA for a data physical file and *SRC for a source physical file. The program allows this parameter only on the CRTTAPF command.
RCDLEN
The parameter RCDLEN specifies the length of records that are used by a program using this device file. If *CALC is specified, the system attempts to calculate record length from the file header labels. The maximum record length is 32 767 bytes for fixed-length or undefined format records, and 32 759 for variable-length or spanned records. Fixed-length and undefined format output records cannot be less than 18 bytes in length.
BLKLEN
The BLKLEN parameter specifies the data block length that transfers on each I/O operation. If *CALC is specified, the system attempts to calculate block length from the file header labels. The block length must be between 18 and 524 288 bytes.
RCDBLKFMT
The RCDBLKFMT parameter specifies the format of the I/O records and blocks. Records can be:
  • D-type ASCII, deblocks (*D)
  • D-type ASCII, blocked (*DB)
  • Fixed-length, deblocked (*F)
  • Fixed-length, blocked (*FB)
  • Variable-length, deblocked, unspanned (*V)
  • Variable-length, blocked, unspanned (*VB)
  • Variable-length, deblocked, spanned (*VS)
  • Variable-length, blocked, spanned (*VBS)
  • Undefined format (variable length) (*U)

The record length, block length, and record block format may not need to be specified for standard-labeled I/O tape data files specified as EXTEND(*YES). The system can take this information from the tape labels. If the program specifies a block length or record block format that does not match tape label specifications in the tape label, the system then assumes the tape label specification.

If the record length specified in the program does not match the length of the data, the system then truncates or pads the data to the length specified in the program

EXTEND
New records can be added to the end of the data file on the tape by specifying the EXTEND parameter. The destruction of all remaining data files occurs if the data file is not the last data file on the tape. The destruction of all remaining data files also occurs when you over-write an existing data file. The extension uses the label specifications for record and block length that are specified in the label. EXTEND is valid only for 1/2-inch tape devices.

By specifying EXTEND(*YES *CHECK), the system checks the expiration date of the first data file following the data file being extended.

DENSITY
The system records, in the same density, all data files on a volume. You use the DENSITY parameter only to set the output volume density when you create the first data file on a volume that is not labeled. You use the volume label on a labeled tape to determine the density format. For valid values, see the CRTTAPF, CHGTAPF, and OVRTAPF commands in the CL topic.
COMPACT
The COMPACT parameter allows the user to control device data compaction for output files. If you do not want to use data compaction, specify *NO on the COMPACT parameter. If you specify *DEVD and the device does not support data compaction, the system ignores this parameter.
CODE
The CODE parameter specifies the character code (EBCDIC or ASCII) for the data that is not labeled. For standard label tapes, the volume label determines the character code. The system writes ASCII Interchange code when the character code is ASCII. The data conforms to the "American National Standard" X3.27-1978,"Magnetic Tape, and File Structure for Information Interchange".
CRTDATE
The CRTDATE parameter specifies the creation date of an input data file on a labeled tape. The system sends a message to the system operator if the creation date on the tape does not match the date in the file description.
EXPDATE
The EXPDATE parameter specifies the expiration date of an output data file on a labeled tape. The program cannot write-over the data file until the date has expired. The program considers the data file protected.

The program might create an output data file instead of extending an existing data file. When this occurs, the system compares the expiration date of the new data file to the date of the file which precedes it on the volume. If the expiration date of the new data file is later than the file preceding it on the tape, the program sends an inquiry message (CPA4036). The system operator can choose one of the following operations:

  • The creation of the data file
  • Load a new tape and try again
  • Allow the program to end processing
Note: Creating the data file can produce a volume for which CHECK(*FIRST) on the INZTAP command is unreliable.

If you do not want the data file to be written over, specify *PERM on the EXPDATE parameter.

ENDOPT

The ENDOPT parameter specifies where to position the magnetic tape when the program closes the tape device file. The program:

  • Rewinds the magnetic tape to the load point.
  • Leaves the magnetic tape as it is.
  • Unloads the magnetic tape.

When you use a multivolume-tape data file and specify ENDOPT(*LEAVE), you must place the first volume on the first tape device specified in the DEV parameter. (The exception to this is for a read backward, in which case you must place the last volume on the first tape device specified.) If a user opens the data file again, with the same device list, and leaves the tape on a different tape device:

  • Place the tape volume on the first tape device that is specified in the DEV parameter before you open the next data file on that tape reel.

Note the following restriction when using *LEAVE processing with tape media libraries. *LEAVE processing restricts the use of the resource that has the current cartridge mounted to that same cartridge. A resource allocation timeout will occur if both of the following conditions exist:

  • The device is the only resource available to the media library.
  • The program issues a request to use a different cartridge.
The resource will remain unavailable to the program until:
  • The program issues a command to rewind or unload the cartridge.
  • The job that left the cartridge in *LEAVE processing ends.
USRLBLPGM
The command supports user header and trailer labels through the use of the USRLBLPGM parameter. USRLBLPGM identifies the user program that is used during open and close processing. See User label processing for more information.
BUFOFSET
The buffer offset length for an ASCII file is specified using the BUFOFSET parameter. You can specify a buffer offset length for any ASCII input data file. You can specify a buffer offset value of
  • *BLKDSC for an input or output ASCII formats *D file
  • *BLKDSC for an input or output ASCII formats *DB file
to process a block with 4-digit block descriptors.
TBL
A conversion table to use for data conversion is specified using the TBL parameter. If *NONE is specified, then no data conversion is performed. If *CCSID is specified, then the CCSID values specified by the FROMCCSID and TOCCSID parameters are used to determine the data conversion to perform. A conversion table can also have a special value of *DFT. If the code is *ASCII (CODE parameter) and TBL(*DFT) is specified, the data and labels will be converted between ISO/ASCII 8-bit code and EBCDIC. When the code is *EBCDIC (CODE parameter) and TBL(*DFT) is specified, the data and labels will not be converted.
FROMCCSID
This parameter is used to specify a CCSID value for the input data. The CCSID specified must be a single-byte CCSID.
TOCCSID
This parameter is used to specify a CCSID value for the output data. The CCSID value must be a single-byte CCSID.

For additional tape information, and information about using tape for save and restore operations, see the Backup and Recovery topic. Table 1 lists parameters that apply to magnetic tape and shows you where to specify the parameters. The CL topic in the Information Center contains detailed information about how to specify these parameters on the CRTTAPF, CHGTAPF, and OVRTAPF commands.

Table 1. Tape device file parameters
CL parameter Description Specified on CRTTAPF command Specified on OVRTAPF command Specified in HLL programs
FILE File name Qualified file name File name ILE RPG, COBOL, BASIC, PL/I, or ILE C programming languages
DEV Device name *NONE or list of device names List of device names  
VOL Volume *NONE or list of volume identifiers *NONE or list of volume identifiers  
REELS Volume label type *SL, *NL, *NS, *BLP, or *LTM *SL, *NL, *NS, *BLP, or *LTM  
REELS Number of labeled tapes Number of reels Number of reels  
SEQNBR Sequence number *NEXT, *END, or sequence number of file *NEXT, *END, or sequence number of file  
LABEL Label *NONE or file label *NONE or file label BASIC
FILETYPE File type *DATA or *SRC    
RCDLEN Record length *CALC or record length *CALC or record length ILE RPG, COBOL, BASIC, PL/I, or ILE C programming languages
BLKLEN Block length *CALC or block length *CALC or block length COBOL programming language
BUFOFSET Buffer offset *BLKDSC or buffer offset *BLKDSC or buffer offset  
RCDBLKFMT Record block format *F, *FB, *V, *VB, *D, *DB, *VS, *VBS, or *U *F, *FB, *V, *VB, *D, *DB, *VS, *VBS, or *U COBOL, ILE C programming languages
EXTEND Extend *NO, *YES *CHECK, or *YES *NOCHECK *NO, *YES *CHECK, or *YES *NOCHECK COBOL, ILE C programming languages
DENSITY Density See the CL topic. See the CL topic.  
COMPACT Data compaction *DEVD or *NO *DEVD or *NO  
CODE Character code *EBCDIC or *ASCII *EBCDIC or *ASCII COBOL programming language
CRTDATE Creation date *NONE or date *NONE or date  
EXPDATE Expiration date *NONE, date, or *PERM *NONE, date, or *PERM  
ENDOPT End option *REWIND, *LEAVE or *UNLOAD *REWIND, *LEAVE or *UNLOAD COBOL programming language
USRLBLPGM User label program *NONE or qualified program name *NONE or qualified program name  
IGCDTA Double-byte data N/A *NO or *YES  
WAITFILE File wait time *IMMED, *CLS, or number of seconds *IMMED, *CLS, or number of seconds  
SHARE Shared file *NO or *YES *NO or *YES  
AUT Authority *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE, or authorization list name N/A  
REPLACE Replace existing file *YES or *NO N/A  
TEXT Text *BLANK or text N/A  
TBL Conversion table N/A Table name or library, *NONE, *CCSID, *DFT  
FROMCCSID From CCSID N/A 1 to 65533  
TOCCSID To CCSID N/A 1 to 65533  
Related concepts
Create Tape File (CRTTAPF) command
Change Tape File (CHGTAPF) command
Override Tape File (OVRTAPF) command
Control language (CL)
User label processing
Related information
Backup and Recovery