We would like to automate a file transfer, and I thought to use the cpyfrmimpf cl command.
The problem is that the .CSV file we wish to copy to our DB2 database has a header row that does not match the column data...some data must appear to the transfer as numeric. When I remove the header row, CPYFRMIMPF works perfectly.
When I code the CPYFRMIMPF COMMAND and request the copy begin at record #2 of the CSV file, the command chokes also. We would like to develop a transfer where no one needs to modify the .CSV file by removing or renaming the column headers so that the transfer completes. We are at V5R4
Software/Hardware used:
ASKED:
August 15, 2006 4:09 PM
UPDATED:
August 16, 2006 10:42 AM
Use the “FRMRCD” keyword or you can get to it by entering “CPYFRMIMPF” on the command line and press F4. Then press F9 to get to all of the parameters. page down one page. See screen print below.
Copy From Import File (CPYFRMIMPF)
Type choices, press Enter.
Remove blanks . . . . . . . . . *LEADING *NONE, *LEADING, *TRAILING…
Field delimiter . . . . . . . . ‘,’ Character value, *TAB
Field definition file:
File . . . . . . . . . . . . . Name
Library . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Member . . . . . . . . . . . . *FIRST Name, *FIRST, *ALL
Decimal point . . . . . . . . . *PERIOD *PERIOD, *COMMA
Date format . . . . . . . . . . *ISO *ISO, *USA, *EUR, *JIS…
Date separator . . . . . . . . . ‘/’ /, -, ., ,, *BLANK
Time format . . . . . . . . . . *ISO *ISO, *USA, *EUR, *JIS, *HMS
Time separator . . . . . . . . . ‘:’ :, ., *BLANK
Copy from record number:
Copy from record number . . . > *first Number, *FIRST
Number of records to copy . . *END Number, *END
Errors allowed . . . . . . . . . *NOMAX Number, *NOMAX