Using CPYTOIMPF to copy records from a physical file to an Excel book

95 pts.
Tags:
Copy To Import File
CPYTOIMPF
Microsoft Excel import/export
Physical File
CPYTOIMPF FROMFILE(SARKNS/ENQP003) TOSTMF('C:/Documents and Settings/user/exc.xls') MBROPT(*REPLACE) RCDDLM(*LF) DTAFMT(*iso) 

Here I have created an Excel book with name exc.xls. My requirement is to copy all the records from my physical file (sarkns/enqp003) to the desired Excel book. When I run this command I am getting a message that zero records are copied. Could you suggest where I went wrong?

Answer Wiki

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

CPYTOSTMF can copy to a folder on the IFS – the 400rd drive not to your pc
I don’t think it can write an xls file .. a comma delimited which excel can pick up — but not formated.
Phil

===============================================================================

Where I’ve needed to output comma delimited files, I’ve built the record(s) into a single-field file, then copied (or FTP’d) the file out with the .csv extension – Excel will pick that up with no additional formatting required.

Copy command can write to IFS:
COPY OBJ(‘qdls/TempFldr/Insrpt2.xls’)
TODIR(‘qntc/accdc01/InterDocs’)
TOCCSID(*CALC) DTAFMT(*BINARY)
REPLACE(*YES))

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
  • mcl
    This has been discussed before here. Check this link Hope it helps.
    2,740 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