CL Command Reference - CPYTOTAP

CL Command List > CPYTOTAP Reference

Description:

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.

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.


Examples:

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.