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).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.