Automate file transfer using CPYFRMIMPF command

pts.
Tags:
Application development
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

You could write a program using the IFS API’s to delete the first record from the CSV file before you use the cpyfrmimpf.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Shockl
    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
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following