Hi,
I changed one variable label as Simplified Chinese and tried to convert .xpt file. However, this label can show text in Simplified Chinese, but it didn't work in xpt file when I open xpt file in SAS Universal. In xpt file, the label appears garbled. The code was shown below. Wondering if this issue could be fixed? Many thanks.
data DM;
set sdtm.dm;
label STUDYID ='研究标识符';
run;
libname xptfile xport "\\sass01\tabulations\sdtm\dm.xpt" encoding = "utf-8";
proc copy in=work out=xptfile;
select dm;
run;
I don't think it is Universal Viewer's fault. There is no place to store ENCODING in an XPORT file.
Hi @Winkle,
I was able to replicate the issue. A recent (Oct 2020) external blog post states that SAS Universal Viewer does "not support any other encodings that [sic] ASCII for XPT files[,]" which "was confirmed to [the blogger] by SAS Support" and that "there are currently no viewers at all that support non-ASCII encoding in SAS-XPT files."
So, extracting the dataset to a library with UTF-8 encoding seems to be the only workaround (as suggested in a 2013 post by our Chinese super user Ksharp; I've successfully tested it as well).
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.