Skip to Content
author's profile photo Former Member
Former Member

OPEN DATASET record length

Hi, All!

I have a string of length 2363 chars w/c I need to write on a file using OPEN DATASET statement. When I copied/opened the generated file from AIX to the presentation server WINDOWS, the record/line is broken into lines as if it was "word wrapped" (notepad).

How can I appear this in one line only.

Regards to all.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 27, 2004 at 10:09 AM

    Hi Rico,

    Your problem has to do with the difference in fileformat between AIX (a Unix clone) based files and f.i. Windows Based files.

    AIX files put ONLY a CR character at the end of a line, where Windows based files put both CR and LF characters at the end of a line.

    When you transfer a file from AIX to Windows (using FTP tools) you take care of conversion by giving the FTP command ASCII before any put of get command.

    For SAP you actually do not need to worry. When using OPEN DATASET the system auto-senses what type of OS is behind it and will take care of the conversion, provided you tell what you want.

    In this case i assume you have a record with data that is written in ASCII characters and therefore you will need to use the OPEN/READ DATASET command as follows:

    DATA: myrecord(2363) TYPE C,

    mytable LIKE myrecord OCCURS 0,

    myfile VALUE '/usr/myfile.asc'.

    OPEN DATASET myfile FOR INPUT IN TEXT MODE.

    DO.

    READ DATASET myfile INTO myrecord.

    IF SY-SUBRC NE 0. EXIT. ENDIF.

    APPEND myrecord TO mytable.

    ENDDO.

    The addition IN TEXT MODE does the trick.

    Furthermore, if you transfer the file from Application Server to Presentation Server with an FTP tool, be sure to do the transfer in ASCII mode (simply use the ftp command ascii before the get command).

    Hope this helps you,

    Regards,

    Rob.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.