Create text file with field names in iSeries data transfer

10 pts.
Data transfer
When using the data transfer from iSeries, I need to create a text file with the field names as the first record. How is this done?

Answer Wiki

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

I am not iSeries person but I have asked the same question from my friend and he suggest me below link. Hope you will get your solution from here.

contact to know more:

Discuss This Question: 5  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.
  • pdraebel
    You could use a DSPFFD command to an output file. I believe there must also be API's that can be used to have a Files field data listed. And probably in some system tables the Field names of all files on your iSeries are listed. Options galore.
    7,545 pointsBadges:
  • ToddN2000
    Is this a flat text file or is the data delimited? If delimited you need the headings in the same format. How are you doing the transfer, the normal way or via the Excel add-on? You may be better off using a SQL script to accomplish this.
    135,485 pointsBadges:
  • Yorkshireman

    Someone else asked - are you wanting a CSV file?

    if not, you will need some way of handling variable length field names.

    I suggest you look at the CPYTOSTMF command, and its beneficent twin CPYFRMSTMF on your IBM i 

    these inbuilt commands will construct a CSV file with your choice of delimiter characters.

    with the created file in the Integrated File System (IFS)  you simply drag and drop or use another transfer mechanism to a windoze or other device

    6,085 pointsBadges:
  • ToddN2000
    Unless you have multiple record formats you need to make the column/fields definitions large enough to hold the text description.
    No a very clean process or results. If you have a column with a freight code, the field is probably a 1A definition. You want to have a field name of FRT_CODE. That means the 8 positions of the text will not fit in the defined size of one. You would need to make all columns large enough to hold the field name length.
    135,485 pointsBadges:
  • TheRealRaven
    When creating your 'File transfer' request, you can choose the 'File type'. Some file types will allow specifying 'Details' that let you 'Include column headings'. The BIFF5 through BIFF8 and the MS ExcelXML file types allow column headings.

    If no supported file type is acceptable, you'll need to use a custom method.
    36,420 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: