CPYFRMIMPF ended in error

230 pts.
Tags:
CLLE
CPYFRMIMPF
I have data in a stream file and im trying to copy that to a flat file as below, but its failing to copy: CPYFRMIMPF FROMSTMF('/Hamsu/Test001.csv') TOFILE(Hams/TST001 *FROMMBR) MBROPT(*REPLACE) RCDDLM(*CRLF) RPLNULLVAL(*FLDDFT) The CSV file will have data delimited by ',' I created file "TST001" in library "Hams" using CRTPF member = *none rcdlen = 2000 The copy command is failing with following messages: Ownership of object QCPIMTEMPS in QTEMP type *USRSPC changed. Ownership of object QACPTEMP01 in QTEMP type *USRSPC changed. Ownership of object QACPTEMP01 in QTEMP type *USRSPC changed. Parameter MBR required. Error found on ADDPFM command. Copy command ended because of error. Can anyone tell me the reason for this failure. I appreciate your time and help
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: 13  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
    What is the name of the member in your physical file?  Most likely it's not going to be there. If you used "CRTPF member = *none rcdlen = 2000" I. You will need to add a member in order to copy the data over. Check your file to see what the max member value is. If it is 0 then you will need to do a CHGPF to set a max member value before you can ass one using the ADDPFM. Then try copying the stream again.
    131,380 pointsBadges:
    report
  • Hamsu
    Yes sir i could see that max member value is not 0.

    Maximum members . . . . . . . . . . . . . . : MAXMBRS        1

    The command now executes without failing but im not getting data in the file TST001. When i opened it in STRSQL i do not see any data that is present in my stream file.
    230 pointsBadges:
    report
  • Hamsu
    I replaced *FROMMBR with *FIRST and command executes without failing but data is not copied correctly.
    230 pointsBadges:
    report
  • ToddN2000
    What is the value of your *TOFILE parameter ? Does it match the name of the member you added to your PF with the ADDPFM command or are you using *FIRST for that as well ?
    131,380 pointsBadges:
    report
  • Hamsu
    Name of the member is same as the name of the file (TST001). *TOFILE (Hams/TST001 *FIRST) as shown in the command.
    230 pointsBadges:
    report
  • ToddN2000
    Try something like this
    CPYFRMIMPF FROMSTMF('/Hamsu/Test001.csv') 
    TOFILE(HAMS/TST001 *FIRST) 
    MBROPT(*REPLACE) RCDDLM(*CRLF) 
    RPLNULLVAL(*FLDDFT)
    131,380 pointsBadges:
    report
  • Hamsu
    I tried this but the result is same.  No data in the file TST001
    230 pointsBadges:
    report
  • ToddN2000
    Have you tried using the following parameters? I have seen them quite a bit in some sample code I have seen

    STMFCODPAG(*STMF) +
    DBFCCSID(37) +
    ENDLINFMT(*LF)
    131,380 pointsBadges:
    report
  • ToddN2000
    you may not get what you are looking for from what I can see, you may need to use CPYFRMSTMF.  It was mentioned in an older post on this site 
    131,380 pointsBadges:
    report
  • Hamsu
    I could not see above parameters even after taking F4 prompt ... but after changing following TOCCSID(37) RCDDLM(*CRLF) one column of data is copied but remaining columns are not copied
    230 pointsBadges:
    report
  • Hamsu
    CPYFRMSTMF FROMSTMF('/Hamsu/Test001.csv') TOMBR('TST001') MBROPT(*REP
    LACE) STMFCCSID(37) ENDLINFMT(*CRLF)                                     
    Object not a QSYS.LIB object.  Object is /tst001.                        
    Stream file not copied.             
                                                  
    I tried as above but still it failed
    230 pointsBadges:
    report
  • ToddN2000
    Try something like this

    CPYFRMSTMF FROMSTMF('/Hamsu/Test001.csv') 
    TOMBR('/QSYS.LIB/HAMS.LIB/TST001.FILE/TST001.MBR') 
    MBROPT(*REPLACE) ENDLINFMT(*CRLF) 

    Here is the IBM help on the command

    131,380 pointsBadges:
    report
  • Hamsu
    Awesome ! It worked sir thank you.
    230 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: