Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Copy To Tape (CPYTOTAP) command copies records to a tape file. The to-file must be a tape file. The from-file can be a physical, logical, DDM, diskette, tape, or an inline data file.
Note: For more information on DDM files, see the Distributed Data Management information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
This command offers a subset of the parameters available on the Copy File (CPYF) command, along with more specific tape-oriented parameters.
Restriction: A file's open data path (ODP) cannot be shared with any other program in the job (routing step) during the copy operation.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FROMFILE | From file | Qualified object name | Required, Positional 1 |
Qualifier 1: From file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
TOFILE | Tape file | Qualified object name | Required, Positional 2 |
Qualifier 1: Tape file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
FROMMBR | From member | Generic name, name, *FIRST, *ALL | Optional |
TOSEQNBR | File sequence number | 1-16777215, *TAPF, *END | Optional |
TOLABEL | Tape label | Character value, *FROMMBR, *TAPF, *NONE | Optional |
TODEV | Device | Single values: *TAPF Other values (up to 4 repetitions): Name |
Optional |
TOREELS | Copy to reels | Element list | Optional |
Element 1: Label processing type | *TAPF, *SL, *NL, *LTM | ||
TORCDLEN | Record length | Integer, *TAPF, *CALC, *FROMFILE | Optional |
TOENDOPT | End of tape option | *TAPF, *REWIND, *UNLOAD, *LEAVE | Optional |
TOVOL | Volume identifier | Single values: *TAPF, *NONE Other values (up to 50 repetitions): Character value |
Optional |
TOBLKLEN | Block length | 1-524288, *TAPF, *CALC | Optional |
TORCDBLK | Record block type | *TAPF, *F, *FB, *V, *VB, *D, *DB, *VS, *VBS, *U | Optional |
TOEXPDATE | File expiration date | Date, *TAPF, *PERM | Optional |
NBRRCDS | Number of records to copy | Unsigned integer, *END | Optional |
COMPACT | Data compaction | *TAPF, *NO | Optional |
Top |
Specifies the name and library of the physical file, logical file, diskette file, or tape file, from which records are copied.
The possible library values are:
Top |
Specifies the file that receives the copied records.
The possible library values are:
Top |
Specifies the database members or the identifiers of the diskette data tape file or the tape file members copied from the from-file. If the from-file is a spooled inline file, *FIRST must be specified for this parameter.
Top |
Specifies the sequence number of the data file that receives the copied records.
For a labeled tape file, the label specified on the TOLABEL parameter must be found at this sequence number. Valid sequence numbers range from 1 through 16777215.
If a new data file is added to the tape to-file, the sequence number must be one higher than the sequence number of the last data file on that volume. No gaps are allowed in the series of sequence numbers. If a sequence number of an existing data file is specified, that file is overwritten, and all following files on the volume are destroyed.
Top |
Specifies the label of the data file that receives the copied records. This data file identifier is ignored for a nonlabeled tape.
If the from-file is a nonlabeled tape file, a label identifier is created for the tape to-file in the form of CPYnnnnn, where nnnnn is the tape sequence number of the data file.
Top |
Specifies the names of devices that are used to copy records to the tape to-file.
Top |
Specifies the type of labeling used on the tape reels that receive the copied records. This system writes only to standard-label tape or to nonlabeled tapes.
Top |
Specifies (in bytes) the length of the records that are written on the tape to-file. The records in the from-file may be truncated or padded with blanks to conform to the record length specified before they are written to the tape. If an existing data file (with standard labels) is being extended on tape, the record length is obtained from the second header label (HDR2). The record length, block length and record block format must be consistently specified. If a new data file is being added or if it is a nonlabeled file, the record length must be explicitly specified by this parameter or by the RCDLEN parameter in one of the tape device file commands.
Top |
Specifies the positioning operation that is done automatically on the last tape volume of the to-file when the tape device-file is closed. For a multivolume tape to-file, all intermediate reels are positioned by specifying the *UNLOAD value. This only applies to the last reel.
Top |
Specifies, for tapes with standard labels, one or more volume identifiers of the tapes that are used when copying records to the tape to-file. The tape volumes must be placed in the device in the same order as the identifiers are specified. A message is sent to the operator if they are not.
You can enter multiple values for this parameter. If you are on an entry display and you need additional entry fields to enter these multiple values, type a plus sign (+) in the entry field opposite the phrase "+ for more", and press the Enter key.
Top |
Specifies (in bytes) the length of data blocks transferred to the tape. The block length must be consistent with the record length and record block format values.
Top |
Specifies the record format and blocking attributes of records that are copied to the tape to-file. The record block format from an existing data file label is used if an existing data file is being extended as the to-file. The record length, block length, and record block format parameters must be consistently specified.
Top |
Specifies the expiration date for the data file that is being added to the to-file. The data file expiration date is established for standard label tape files only and is stored in the tape header label immediately preceding the data file that the label describes.
Top |
Specifies the number of records copied to the to-file.
Top |
Specifies whether device data compaction is performed. If the tape device used by the to-file does not support data compaction, this parameter is ignored.
The possible values are:
Top |
Example 1: Copying the First Member in a Database File to Tape
CPYTOTAP FROMFILE(MYLIB/MYFILE) TOFILE(QTAPE) TODEV(QTAPE1) TORCDLEN(*FROMFILE) TOEXPDATE(10 15 89)
This command copies the first member in database file MYFILE in library MYLIB to tape. The tape device file QTAPE is used which has attributes of SEQNBR(1) and RCDBLKFMT(*F), which are used as defaults for parameters TOSEQNBR and TORCDBLK. The additional attributes specified on the copy command include the tape device name and the expiration date of the file written on tape. The label name used on tape is the same name as that of the member copied. The record length of the tape file is also the same as the database from-file record length since TORCDLEN (*FROMFILE) was specified.
Example 2: Copying a Member in a Database File to Tape
CPYTOTAP FROMFILE(MYLIB/MYFILE) TOFILE(QTAPE) FROMMBR(M1) TOLABEL(BACKUPM1) TODEV(QTAPE1) TORCDLEN(50) TOBLKLEN(1000) TORCKBLK(*FB) TOENDOPT(*LEAVE)
This command copies member M1 from database file MYFILE in library MYLIB to tape, using tape device file QTAPE. The records are copied to label BACKUPM1 on tape device QTAPE1 and the reel is left at its current position when the copy is completed. The data file written on tape has fixed-length 50-byte records that are blocked 1000 bytes (or 20 records) to a block.
Top |
*ESCAPE Messages
Top |