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

Write file in OS/400 library

Hi everybody

I am requested to save data from ABAP to a flat file in a <b>library</b> in OS/400. The name of the library is LEISAP. Searching around, I found out that I can access it using the path /QSYS.LIB/LEISAP.LIB/ and it already has some files. I am able to read the files in this library (for example the file MPSHR01606) using OPEN DATASET FOR INPUT with a filename like /QSYS.LIB/LEISAP.LIB/MPSHR01606.FILE/MPSHR01606.MBR.

But I can not figure out how to create a new file. What I am trying to do is:

OPEN DATASET file

FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

where file has the value '/QSYS.LIB/LEISAP.LIB/TEST.FILE/TEST.MBR', but it fails with sy-subrc = 8.

Any idea if it is possible to create a file in a libary in OS/400 from ABAP at all and how?

Thank you

Andreas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 07, 2006 at 11:52 PM

    Does it have to be in a library? Is this AS/400 running your SAP instance? If so, usually it is a good idea to right to the application server under /usr folder. This is under the IFS of the as/400.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 09:57 PM

    Hi

    Just to update the status: I was able to create file members with OPEN DATASET inside files that already exist. So all I am missing is how to create the files in the library.

    Andreas

    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.