File Management - IBM

File Management - IBM File Management - IBM

as400bks.rochester.ibm.com
from as400bks.rochester.ibm.com More from this publisher
30.06.2013 Views

Copying files: overview 70 File Management V4R5 v “Printing records (PRINT, OUTFMT, and TOFILE(*PRINT) parameters)” on page 105 v “Adding or changing source file sequence number and date fields (SRCOPT and SRCSEQ Parameters)” on page 120 v “Preventing errors when copying files” on page 122 v “Improving copy performance” on page 129 v “Year 2000 support: date, time, and timestamp considerations” on page 130 You can use the copy function to move data between device files, between database files (including distributed DB2 Multisystem files), or between device and database files. Unlike traditional copy utilities, the AS/400 copy function is field-level sensitive. Therefore, if you use the copy function, you can rearrange, enlarge, or drop any of the fields. The system also provides a way to define database files. Specific copy commands simplify dealing with tape and diskette units, database source files, and open query files. Copying files: commands You can copy records to and from files by using the following commands: CPYF Copy File copies all or part of a file from the database or external device to the database or external device. CPYFRMDKT Copy from Diskette copies from a diskette file to a database or device file. The from-file must be a diskette file for this command, but the to-file can be a physical, program-described printer, tape, or diskette file. You can obtain a formatted listing of the records by using the IBM-supplied printer file, QSYSPRT. CPYTODKT Copy to Diskette copies a database or device file to a diskette file. The to-file must be a diskette file. The from-file can be a physical, logical, tape, diskette, or inline data file. CPYFRMTAP Copy from Tape copies from a tape file to a database or device file. The from-file must be a tape file, but the to-file can be a physical file, diskette file, tape file, or program-described printer file. You can obtain a formatted listing of the records by using QSYSPRT. CPYTOTAP Copy to Tape copies from a database or device file to a tape file. The to-file must be a tape file, but the from-file can be a physical, logical, diskette, tape, or inline data file. CPYSRCF Copy Source File copies a database source file to a source physical file and converts the data in the from-file to the to-file CCSID. You can create a formatted listing by using QSYSPRT (the file is changed for source records and is different from other copy command file formats). Record data is

copied from the from-file to the to-file, disregarding differences in record formats (similar to the FMTOPT(*NOCHK) parameter option on the CPYF command, except for the CCSIDs.) CPYFRMQRYF Copy from Query File copies an open query file to a database or device file. The system does not reclaim DDM conversations for a job when a copy command produces an error. Note: In releases prior to Version 3 Release 2, copy errors caused the Reclaim Resources (RCLRSC) command to run, which also ran the Reclaim Distributed Data Management Conversations (RCLDDMCNV) command. Although the RCLRSC command still runs, it no longer runs the RCLDDMCNV command when a copy error occurs. If you specify a DDM file and a local file on the CPYF or CRYSRCF commands, the system does not verify that the remote and local files are not the same file on the source system. If you specify one DDM file, you can potentially copy to and from the same file. For information on how to copy DBCS-open fields to graphic fields (including the option of removing trailing single-byte blanks for the DBCS-open field first), see “DBCS-graphic fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)” on page 115. Throughout this topic, unless the text specifies a specific command, the term copy commands refers to all the commands just described. The device and database files where you can perform copy operations are shown in Table 9. Table 9. Copy Operations From-Files To-Files DDM DDM Diskette 1 Diskette 1 Logical Physical 2 Open Query 3 Printer Physical *PRINT 4 Inline Data 5 Tape Tape Chapter 4. Copying files 71

Copying files: overview<br />

70 <strong>File</strong> <strong>Management</strong> V4R5<br />

v “Printing records (PRINT, OUTFMT, and TOFILE(*PRINT) parameters)” on<br />

page 105<br />

v “Adding or changing source file sequence number and date fields (SRCOPT and<br />

SRCSEQ Parameters)” on page 120<br />

v “Preventing errors when copying files” on page 122<br />

v “Improving copy performance” on page 129<br />

v “Year 2000 support: date, time, and timestamp considerations” on page 130<br />

You can use the copy function to move data between device files, between<br />

database files (including distributed DB2 Multisystem files), or between device and<br />

database files. Unlike traditional copy utilities, the AS/400 copy function is<br />

field-level sensitive. Therefore, if you use the copy function, you can rearrange,<br />

enlarge, or drop any of the fields. The system also provides a way to define<br />

database files. Specific copy commands simplify dealing with tape and diskette<br />

units, database source files, and open query files.<br />

Copying files: commands<br />

You can copy records to and from files by using the following commands:<br />

CPYF Copy <strong>File</strong> copies all or part of a file from the database or external device to<br />

the database or external device.<br />

CPYFRMDKT<br />

Copy from Diskette copies from a diskette file to a database or device file.<br />

The from-file must be a diskette file for this command, but the to-file can<br />

be a physical, program-described printer, tape, or diskette file. You can<br />

obtain a formatted listing of the records by using the <strong>IBM</strong>-supplied printer<br />

file, QSYSPRT.<br />

CPYTODKT<br />

Copy to Diskette copies a database or device file to a diskette file. The<br />

to-file must be a diskette file. The from-file can be a physical, logical, tape,<br />

diskette, or inline data file.<br />

CPYFRMTAP<br />

Copy from Tape copies from a tape file to a database or device file. The<br />

from-file must be a tape file, but the to-file can be a physical file, diskette<br />

file, tape file, or program-described printer file. You can obtain a formatted<br />

listing of the records by using QSYSPRT.<br />

CPYTOTAP<br />

Copy to Tape copies from a database or device file to a tape file. The to-file<br />

must be a tape file, but the from-file can be a physical, logical, diskette,<br />

tape, or inline data file.<br />

CPYSRCF<br />

Copy Source <strong>File</strong> copies a database source file to a source physical file and<br />

converts the data in the from-file to the to-file CCSID. You can create a<br />

formatted listing by using QSYSPRT (the file is changed for source records<br />

and is different from other copy command file formats). Record data is

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!