File Management - IBM
File Management - IBM File Management - IBM
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
- Page 30 and 31: Application 1 Application 2 Applica
- Page 32 and 33: 22 File Management V4R5 LVLCHK(*NO)
- Page 34 and 35: The open feedback area also contain
- Page 36 and 37: 26 File Management V4R5 Table 6. OS
- Page 38 and 39: 28 File Management V4R5 Table 7. Ma
- Page 40 and 41: 30 File Management V4R5 Depending o
- Page 42 and 43: 32 File Management V4R5
- Page 44 and 45: 34 File Management V4R5 Handling ov
- Page 46 and 47: 36 File Management V4R5 output queu
- Page 48 and 49: 38 File Management V4R5 The followi
- Page 50 and 51: 40 File Management V4R5 application
- Page 52 and 53: 42 File Management V4R5 activation
- Page 54 and 55: Program A (in user default activati
- Page 56 and 57: 46 File Management V4R5 Override 1
- Page 58 and 59: 48 File Management V4R5 same call l
- Page 60 and 61: 50 File Management V4R5 Program A .
- Page 62 and 63: 52 File Management V4R5 Applying OV
- Page 64 and 65: Deleting overrides 54 File Manageme
- Page 66 and 67: Program A (in user default activati
- Page 68 and 69: 58 File Management V4R5 Displaying
- Page 70 and 71: 60 File Management V4R5 Command 7 d
- Page 72 and 73: 62 File Management V4R5 Display All
- Page 74 and 75: Redirecting files 64 File Managemen
- Page 76 and 77: 66 File Management V4R5 Default act
- Page 78 and 79: 68 File Management V4R5 From Databa
- Page 82 and 83: 72 File Management V4R5 Table 9. Co
- Page 84 and 85: Table 10. Summary of Copy Functions
- Page 86 and 87: 76 File Management V4R5 Copying fil
- Page 88 and 89: Resending copy file completion mess
- Page 90 and 91: 80 File Management V4R5 from-file m
- Page 92 and 93: CPYSRCF command support for CCSIDs
- Page 94 and 95: | | | | | | | | | | | | | | | | | |
- Page 96 and 97: | | | | | | | | | | | | | | | | 86
- Page 98 and 99: | | | | | | | | | | | | | | | | | |
- Page 100 and 101: 90 File Management V4R5 Copying onl
- Page 102 and 103: Selecting the records to copy 92 Fi
- Page 104 and 105: 94 File Management V4R5 Selecting r
- Page 106 and 107: 96 File Management V4R5 Example: bu
- Page 108 and 109: 98 File Management V4R5 When you sp
- Page 110 and 111: 100 File Management V4R5 A field na
- Page 112 and 113: 102 File Management V4R5 v “Null-
- Page 114 and 115: 104 File Management V4R5 - INCCHAR(
- Page 116 and 117: When you specify PRINT(*EXCLD), the
- Page 118 and 119: Note: It is possible for files with
- Page 120 and 121: 110 File Management V4R5 Variable-L
- Page 122 and 123: Table 14 on page 112 outlines the c
- Page 124 and 125: 114 File Management V4R5 in the cur
- Page 126 and 127: 116 File Management V4R5 (including
- Page 128 and 129: | | | | | | | | | | | | | | | | | |
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