File Management - IBM
File Management - IBM File Management - IBM
Using the Copy From Import File (CPYFRMIMPF) command to copy between different systems The Copy From Import File (CPYFRMIMPF) commandmaps or parses the data from (″import″) an import file to the to-file For more information on the CPYFRMIMPF command, see “Notes on the CPYFRMIMPF command” and “Restrictions on the CPYFRMIMPF command” on page 141. Depending on what type of file the import file is, there are different steps to use when running CPYFRMIMPF. See the following topics for more information on the appropriate steps: v “(CPYFRMIMPF) Importing data to the AS/400 when the from-file is a database file or DDM file” on page 141 v “(CPYFRMIMPF) Importing data to AS/400 when the import file is a stream file” on page 142 The CPYFRMIMPF command also supports a parallel data loader to copy information from an import file to a to-file using multiple jobs during the copy. To use multiple jobs, the system must have the Symmetric Multiprocessing Product (SMP). See “Parallel data loader support to use with the CPYFRMIMPF command” on page 143 for more information on Parallel Data Loader support. Using the Copy To Import File (CPYTOIMPF) command to copy between different systems 140 File Management V4R5 The Copy To Import File (CPYTOIMPF) command copies the data from the from-file to an import file. You can then move the import file (or file to be exported) to your platform by any method you choose, such as TCP/IP file transfer (text transfer), CA/400 support (file transfer, ODBC), or CPYTOTAP (copy to tape file) command. Your system then handles the data from the import file in one of two ways. See “Handling data from the import file” on page 143 for more information. The user can also specify a stream file, and the CPYTOIMPF will copy the data to the stream file. For more information on the CPYTOIMPF command, see “Notes on the CPYTOIMPF command” on page 146. Notes on the CPYFRMIMPF command The authority needed to perform the copy using the CPYFRMIMPF command is similar to the authority requirements for all other copies. The from-file can be any of the following: v A stream file v A DDM file v A tape file v A source physical file v A distributed physical file v A program described physical file v A single format logical file v An externally described physical file with one field. The one field cannot be a numeric data type. The to-file can be any of these:
v A source file v A DDM file v A distributed physical file v A program described physical file v An externally described physical file The field definition file can be any of these: v A source physical file v A DDM file v A program described physical file v An externally described physical file with one field The error file can be any of the following: v A source physical file v A DDM file v A program described physical file v An externally described physical file with one field Note: The format of the error file and from-file must be the same. Restrictions on the CPYFRMIMPF command The following restrictions apply to the CPYFRMIMPF command: v The data type of the from-file can be one of two types: – A source physical file – A physical file with one field with a data type of CHARACTER, IGC OPEN, IGC EITHER, IGC ONLY, GRAPHIC, or variable length v The copied records do not have the same relative record numbers in the to-file as in the from-file. v Create the to-file prior to copying. v The command restricts the correct usage for delimiters. v The to-file and from-file cannot be the same file. – If a record from the from-file cannot be imported, the process continues based on the Errors Allowed (ERRLVL) parameter. – If the from-file is a stream file, a temporary database file is created in QRECOVERY. The naming convention for these types of files is QACPXXXXXX where the system fills in XXXXXX. – If the from-file is a source file, the system does not copy the first 12 bytes of the record (Sequence field and Date field). If the to-file is a source file, the system sets the first 12 bytes of the to-file’s data (Sequence field and Date field) to zeros. You can use this command on files that contain user-defined types (UDTs) and user-defined functions (UDFs). You cannot use this command on files that contain large objects (LOBs) or DataLinks (DLs). (CPYFRMIMPF) Importing data to the AS/400 when the from-file is a database file or DDM file The from-file contains the data you want to import to AS/400. To import data for a database file or DDM file, follow these steps: 1. Create an import file for the data that you can copy to a DB2 for AS/400 externally described file. The import file can be a database source file, an Chapter 4. Copying files 141
- 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: | | | | | | | | | | | | | | | | | |
- Page 130 and 131: | | | | | | | | | | | | | | | | | |
- Page 132 and 133: Preventing errors when copying file
- Page 134 and 135: elationship. However, the copy oper
- Page 136 and 137: Preventing allocation errors when c
- Page 138 and 139: 128 File Management V4R5 - A depend
- Page 140 and 141: Year 2000 support: date, time, and
- Page 142 and 143: FLD TYPE DATFMT SPECIFIED FIELD LEN
- Page 144 and 145: Restrictions for Year 2000 support
- Page 146 and 147: | | | | | | | | | | AS/400 supports
- Page 148 and 149: | | | | | | | | | | | | | | | | | |
- Page 152 and 153: externally described database file
- Page 154 and 155: 144 File Management V4R5 v Two adja
- Page 156 and 157: - Description: This Field Definitio
- Page 158 and 159: Date Fields All date formats suppor
- Page 160 and 161: 150 File Management V4R5 Figure 14
- Page 162 and 163: devices that process the same type
- Page 164 and 165: Default system output queues 154 Fi
- Page 166 and 167: Spooling writers 156 File Managemen
- Page 168 and 169: value of *OWNER indicates that only
- Page 170 and 171: 160 File Management V4R5 You can us
- Page 172 and 173: 162 File Management V4R5 QFNC Finan
- Page 174 and 175: 164 File Management V4R5 If a job b
- Page 176 and 177: Spooling subsystem 166 File Managem
- Page 178 and 179: 168 File Management V4R5 the DLTSPL
- Page 180 and 181: Table 20. Open Feedback Area (conti
- Page 182 and 183: Table 20. Open Feedback Area (conti
- Page 184 and 185: Table 21. Device Definition List (c
- Page 186 and 187: Table 21. Device Definition List (c
- Page 188 and 189: Table 21. Device Definition List (c
- Page 190 and 191: Table 23. Common I/O Feedback Area
- Page 192 and 193: Table 23. Common I/O Feedback Area
- Page 194 and 195: Table 23. Common I/O Feedback Area
- Page 196 and 197: Table 24. I/O Feedback Area for ICF
- Page 198 and 199: Table 24. I/O Feedback Area for ICF
v A source file<br />
v A DDM file<br />
v A distributed physical file<br />
v A program described physical file<br />
v An externally described physical file<br />
The field definition file can be any of these:<br />
v A source physical file<br />
v A DDM file<br />
v A program described physical file<br />
v An externally described physical file with one field<br />
The error file can be any of the following:<br />
v A source physical file<br />
v A DDM file<br />
v A program described physical file<br />
v An externally described physical file with one field<br />
Note: The format of the error file and from-file must be the same.<br />
Restrictions on the CPYFRMIMPF command<br />
The following restrictions apply to the CPYFRMIMPF command:<br />
v The data type of the from-file can be one of two types:<br />
– A source physical file<br />
– A physical file with one field with a data type of CHARACTER, IGC OPEN,<br />
IGC EITHER, IGC ONLY, GRAPHIC, or variable length<br />
v The copied records do not have the same relative record numbers in the to-file<br />
as in the from-file.<br />
v Create the to-file prior to copying.<br />
v The command restricts the correct usage for delimiters.<br />
v The to-file and from-file cannot be the same file.<br />
– If a record from the from-file cannot be imported, the process continues based<br />
on the Errors Allowed (ERRLVL) parameter.<br />
– If the from-file is a stream file, a temporary database file is created in<br />
QRECOVERY. The naming convention for these types of files is<br />
QACPXXXXXX where the system fills in XXXXXX.<br />
– If the from-file is a source file, the system does not copy the first 12 bytes of<br />
the record (Sequence field and Date field). If the to-file is a source file, the<br />
system sets the first 12 bytes of the to-file’s data (Sequence field and Date<br />
field) to zeros.<br />
You can use this command on files that contain user-defined types (UDTs) and<br />
user-defined functions (UDFs). You cannot use this command on files that contain<br />
large objects (LOBs) or DataLinks (DLs).<br />
(CPYFRMIMPF) Importing data to the AS/400 when the<br />
from-file is a database file or DDM file<br />
The from-file contains the data you want to import to AS/400. To import data for a<br />
database file or DDM file, follow these steps:<br />
1. Create an import file for the data that you can copy to a DB2 for AS/400<br />
externally described file. The import file can be a database source file, an<br />
Chapter 4. Copying files 141