CPYFRMIMPF try copy data from a TXT file to DB file

20 pts.
Tags:
AS 400
CPYFRMIMPF
FTP
I am using the CPYFRMIMPF to copy data from a TXT file into a DB file, but the result is "corrupt data" or any other format unreadable, I don't know what happened, because I have done this in previous works. The first command was:
CPYFRMIMPF FROMSTMF('/FILEST.TXT') TOFILE(*LIBL/TESTF) MBROPT(*REPLACE) RCDDLM(*CRLF) RPLNULLVAL(*FLDDFT)
and the result was "data corrupt" then add:
STRDLM(*NONE) FLDDLM(']')
But the result was the same.    A line from the input file (FILEST.TXT): 12345678987654323456787654323456787654345676545678767288812732918372198463648762389746239746382476238476238476328476 NOTE: the file "FILES.TXT", was uploaded by FTP. NOTE2: I replicate the file "FILES.TXT" whit a command CPYTOIMPF and the command CPYFRMIMPF works correctly.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
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.
  • ToddN2000
    How is the DB file set up with field definitions? If  " ]  " is the delimiter, I do not see one in your sample line from FILEST.TXT.  How large are the fields being parsed into the database? 
    132,690 pointsBadges:
    report
  • eroek182
    EUREKA, i did it, the problem was in the CCSID
    20 pointsBadges:
    report
  • ToddN2000
    Glad to hear you found a solution. 
    Sometimes a flat file can give you headaches, that is why I prefer working with CSV or tab delimited files.
    132,690 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.

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

Following

Share this item with your network: