I currently have an xlsx file with thai characters in it which is correctly displayed in excel.
However when I import this file in SAS EG 4.3 (Also tried in 5.1) the thai characters are displayed as "???"
Here is the sample code for the same
DATA WORK.pthai;
LENGTH F1 $4 ;
FORMAT F1 $UTF8X4. ;
INFORMAT F1 $UTF8X4. ;
INFILE 'C:\Users\rohit_000\AppData\Local\Temp\SEG12960\pthai-507bc48108424b79810743ea724b0861.txt'
LRECL=4
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD ;
INPUT F1 : $UTF8X4. ;
RUN;
I have also tried all sorts of encoding and I also encountered an error saying cannot covert to wlatin1 from utf-16le.
Is there any way how I can get this character to display in SAS Tables?
I believe your SAS session has to be using the correct encoding. If you open the sasv9.cfg file in the same directory as your sas.exe file, you will see the following line:
-config "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
change the "en" to "u8" and re-open SAS and import the file.
In general it's not a good habit to stay in u8, as it can prevent other users from opening SAS datasets with utf-8 encoding.