04-07-2011 2:22 AM
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.
04-07-2011 6:17 AM
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
12-13-2011 1:42 AM