Skip to Content
author's profile photo
Former Member

Transfer records to UNIX with different record length

Hi all,

I have the following problem. I have to transfer records to a UNIX file. The maximum length of a record is 2000. The records are TAB seperated. I also have records which have a length less then 2000. When i look at the file in Excel the last field is always very large. Isn't there a way to only transfer the real length of the record. I have tried to transfer the record in Binary an Text mode. I used the Length statement, but nothing worked for me.

Hope anyone can help me.

Greetings Maarten

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Posted on Dec 27, 2004 at 09:03 PM

    Hi Maarten,

    "Transfer" with "length" option should work. I am not sure what you passed as length to the "transfer" command. Did you used a fixed length of 2000 or did you actually found out the record length of each record and passed that value?

    Scenario 1.

    Here in this scenario, you will always have the last field set to maximum length.

    loop at itab.

    transfer itab-record to file length 2000.

    endloop.

    Scenario 2.

    In this second scenario, you should have your excel's last field set to the maximum occupied length of that field.

    loop at itab.

    v_len = strlen( itab-record ).

    transfer itab-record to file length v_len.

    endloop.

    Hope this helps.

    Srinivas

    Add comment
    10|10000 characters needed characters exceeded