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: 

ASCII/UTF-8 with open dataset

Former Member
0 Kudos

Hi Folks,

I have one program which writes a file in file share. But sometimes this files creating as ASCII and sometimes UTF-8, even though the code pointing to normal ASCII file.

So is there any way to differentiate the file format with OPEN DATA SET statement? And do you have any thoughts on this like when it will create ASCII/UTF-8?

OPEN DATASET GV_FILENAME FOR APPENDING
          IN LEGACY TEXT MODE CODE PAGE GV_CODEPAGE MESSAGE GV_MSG
          REPLACEMENT CHARACTER GV_REPLCHAR
          IGNORING CONVERSION ERRORS
          FILTER GV_FILTER.

If you have any thoughts please share with me.

Regards,

Raghu.

2 REPLIES 2

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Raghu,

But sometimes this files creating as ASCII and sometimes UTF-8, even though the code pointing to normal ASCII file.

Why are you using the LEGACY TEXT MODE option? LEGACY option should be used if there is a non-UC system involved.

If you specify ENCODING DEFAULT, then the encoding would be UTF-8. Read the F1 documentation on OPEN DATASET for further details.

BR,

Suhas

Former Member
0 Kudos

Thanks