Export multiple files to Excel using CL

100 pts.
Tags:
AS/400 import/export
AS/400 queries
CL programming
Exporting AS/400 to Excel
Microsoft Excel
Microsoft Excel import/export
Hello, I have these queries on a job schedule now and I want to export them to Excel using CL. 

PGM RUNQRY MYENTRIES1 RUNQRY MYENTRIES2 COPYTOIMPF FROMFILE(MYLIB/MYFILE1) (MYLIB/FILE2) ENDPGM 

Where do I send these two files to? And can I run both queries this way?
ASKED: January 8, 2009  7:57 PM
UPDATED: August 23, 2013  4:47 PM

Answer Wiki

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

Hi,

The CPYTOIMPF command can place your output files from your queries into a stream file in the IFS for you. The IFS is a sort of network share which you can access from your PC or network server. You will need to run the CPYTOIMPF command for each file that your queries create.

You will also need to check the parameters on the CPYTOIMPF command to get them correct for the type of file you want to use for excel (you can probably use the defaults to get comma delimited files) – there is plenty of help available on the command – press F1 for help – F2 for extended help.

Regards,

Martin Gilbert.

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
  • Gilly400
    Hi, You'll probably also need to add a mapped drive to your PC or network server to access the IFS on your AS400. You should be able to do this from windows explorer -> Tools - > Map Network Drive. Regards, Martin Gilbert.
    23,730 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