Application Development and Automation 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: 
Read only

Error creating file with open dataset in text mode

Former Member
0 Likes
795

Hi,

I'm trying to create a file with the following instruction:

OPEN DATASET '/tmp/200808200905.txt' in text mode message msg.

When this instruction is executed the sy-subrc is equal to 8 and msg variable says 'No such file or directory', then the next instruction is:

TRANSFER 'xxx' TO '/tmp/200808200905.txt', and this instruction woks fine, sy-subrc = 0 and the file is created but as the documentation says the file is created in binary mode but I need in text mode.

Anyone can help me?

Thanks.

Juan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
641

try this way and see..

data: file type rlgrap-filename.

file = ''/tmp/200808200905.txt' .

OPEN DATASET file for output in text mode message msg encoding default.

Hi,

I'm trying to create a file with the following instruction:

OPEN DATASET '/tmp/200808200905.txt' in text mode message msg.

When this instruction is executed the sy-subrc is equal to 8 and msg variable says 'No such file or directory', then the next instruction is:

TRANSFER 'xxx' TO '/tmp/200808200905.txt', and this instruction woks fine, sy-subrc = 0 and the file is created but as the documentation says the file is created in binary mode but I need in text mode.

Anyone can help me?

Thanks.

Juan.

2 REPLIES 2
Read only

Former Member
0 Likes
642

try this way and see..

data: file type rlgrap-filename.

file = ''/tmp/200808200905.txt' .

OPEN DATASET file for output in text mode message msg encoding default.

Read only

0 Likes
641

Hi Vijay,

Thanks for your answer. Now it works.

Thanks.