Transfer a PF into Excel with column headings instead of fields

Is it possible that when I transfer a file from a PF on the iSeries to Excel that I could get the column headings for each field instead of the fields names? Currently using rpgivtools commands cpytormtf/sndftpf to download to network drive. Suggestions?

Answer Wiki

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

I’ve used a CL Program in the past to copy files to a .CSV format. The writers name is Herb Bujak and you can get a copy of the program here.,289483,sid3_gci873462,00.html

I hope this helps.



If the question is simply how to transfer files for use by Excel with field names in the first row, the simplest option is probably a iSeries Access file transfer request in .DIF format. You might even create a VIEW that exposes the fields as you’d like them along with descriptive column names.

If it must be initiated from the iSeries, you might use RUNRMTCMD to execute it. But once the transfer request is created, it’s usually easy enough for the user to initiate.

As a bonus, .DIF files also work great to transfer to Open Office Calc.


Discuss This Question: 2  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.
  • Imazing
    This is how I got around the same issue. I created a spreadsheet with the headings I wanted and save it as csv. Then when I do my file transfer I just copy this excel spreadsheet to the location that the physical file is going. But I used the cpytoimpf with the comma separated and append option. Then I created a Physical file to hold these values and created a ILE program to process it. This a little manual but the only way I could do it. If you find an easier way please let me know please.
    0 pointsBadges:
  • EricWL
    This is my workaround to the field name limitation. Column headings for my spreadsheet are stored on the i5 in a file F55001B which I maintain with DFU. I copy the heading row (row 1) with the command: CPYTOIMPF FROMFILE(F55001B) + TOSTMF('/QNTC/server/rmaO/text.TXT') + MBROPT(*REPLACE) + STMFCODPAG(*PCASCII) + RCDDLM(*CRLF) I append data to this text file with CPYTOIMPF MBROPT(*ADD) In Microsoft Excel, on menu bar, select Data > Import External Data, and define an import from the text.txt file. Users can then refresh this Excel worksheet by clicking the red Exclamation point(!) icon. EricWL
    0 pointsBadges:

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.


Share this item with your network: