Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a file into UNIX!

Former Member
0 Kudos

Hi Group!

I am trying to write an error file into UNIX directory using 'OPEN DATASET ERRFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT'. But unfortunately i am getting a dump as it is giving the subrc 8 and dumping with CX_SY_FILE_OPEN_MODE.

The path looks like /sap/DE1/batch/data/SCM_YM/partfiles/HGMEH011.20071001150344

Is there any special command or way to write the file into UNIX?

Quick response would be of great help.

Suresh

5 REPLIES 5

Former Member
0 Kudos

Hi Suresh,

Check if you are not using OPEN DATASET twice. It will throw error if file is already open.

Thanks,

Mohaiyuddin

0 Kudos

No Mohaiyuddin,

I am not using the statement twice,

It happens only once.. the thing is i am just trying to create a new file (with time stamp for every run) with the given name into UNIX.

As per the keyword a new file should be created if it is not there.

the INPUT mode is working perfectly, the problem is with OUTPUT mode only.

Suresh

0 Kudos

Hi,

Check with your basis if you hav eauthorization to write files in the app.server.

Regards,

Subramanian

Former Member
0 Kudos

you can try checking with basis as suggested by Subramanian. But I think in that case error should be CX_SY_FILE_AUTHORITY.

Suresh : Can you try Update Mode just to check if that works.

Regards,

Mohaiyuddin

0 Kudos

The detailed error is

The file '&FILENAME&' was not opened, or was opened in the wrong mode.

Can you please try to create a new file that does not exist.

then we can check whether you have authorization or not.

OPEN DATASET to a file already opened - in the same internal mode - triggers the exception.

THtas why you just create a file with some rough name ( may be ur name) intially and then check.

bye sasi