30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

externally described database file which has one field, or a program described<br />

physical file. If the file has one field, the data type must be CHARACTER, IGC<br />

OPEN, IGC EITHER, IGC ONLY, GRAPHIC, or variable length. The record<br />

length of the import file should be long enough to contain the longest record of<br />

the file being sent to the AS/400.<br />

2. Send the data to the import file or from-file. Sending the data into the import<br />

file causes the necessary ASCII to EBCDIC data conversions to occur. There are<br />

several ways to import the data such as:<br />

v TCP/IP file transfer (text transfer)<br />

v CA/400 support (file transfer, ODBC)<br />

v CPYFRMTAP command (copy from tape file)<br />

3. Create a DB2 for AS/400 externally described database file, or DDM file, which<br />

will contain the resultant data of the import file.<br />

4. Use the CPYFRMIMPF command to copy (translate or parse the records) from<br />

the import file to the to-file. For importing large files, you can choose to have<br />

the import file split-up into multiple parts so that each part can be processed in<br />

parallel on an N-way multi-processor system. See “Parallel data loader support<br />

to use with the CPYFRMIMPF command” on page 143 for more information<br />

about using multiple jobs during the copy.<br />

5. You should also use the following “Tips to improve the performance of the<br />

CPYFRMIMPF command”.<br />

Tips to improve the performance of the CPYFRMIMPF command<br />

Follow these steps to inprove the performance of the CPYFRMIMPFcommand:<br />

1. Delete any logical keyed files based on the TOFILE.<br />

2. Remove all constraints and triggers of the TOFILE.<br />

3. Ensure the FROMFILE records will be copied correctly by attempting to copy a<br />

few of the records. Copy a few of the records using the FROMRCD and<br />

number of records option.<br />

4. Use the ERRLVL(*NOMAX) parameter after you know you can copy the data<br />

correctly.<br />

5. When the ERRLVL(*NOMAX) parameter is used, record blocking increases<br />

performance. If an error in writing a record occurs during record blocking, the<br />

number of records listed as being copied in the completion message, CPC2955,<br />

may not be accurate.<br />

(CPYFRMIMPF) Importing data to AS/400 when the import file<br />

is a stream file<br />

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

If the import file is a stream file, use the following steps for importing data to the<br />

AS/400:<br />

1. Create a DB2 for AS/400 externally described database file, or DDM file, which<br />

will contain the resultant data of the import file.<br />

2. Use the CPYFRMIMPF command to copy (translate or parse the records) from<br />

the import file to the to-file. For importing large files, you can have the import<br />

file split-up into multiple parts. The multiple parts then process in parallel.<br />

3. When the stream file (the import file) has records to copy to the externally<br />

described database or DDM file (the to-file), a temporary file is created to<br />

contain the job or jobs from that stream file. The temporary file, created by the<br />

system, acts as an intermediate place for holding records, and then copying

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

Saved successfully!

Ooh no, something went wrong!