BookmarkSubscribeRSS Feed
Winkle
Calcite | Level 5

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;

 

 

 

 

 

2 REPLIES 2
Tom
Super User Tom
Super User

I don't think it is Universal Viewer's fault. There is no place to store ENCODING in an XPORT file.

image.png

FreelanceReinh
Jade | Level 19

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).

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1293 views
  • 5 likes
  • 3 in conversation