- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I'm converting SAS datasets to SAS xport(.xpt) files by using PROC COPY. Chinese characters in SAS datasets are displayed well in SAS 9.4 and SAS universal viewer, but after converted in .xpt file, they become messy code in SAS universal viewer and can't be opened in SAS 9.4.
Is there a solution to make the Chinese characters show well in .xpt file?
Any tips or suggestions are very much appreciated!
Thanks a lot in advance.
Zoe
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suspect you will need to use PROC CPORT / CIMPORT to support the usage of DBCS character sets like Chinese.
The NLS manual should help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your suggestion. I tried to use PROC CPORT, but it didn't work. And, using PROC CPORT, the .xpt file can't even be opened by SAS universal viewer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Zoe_Steven - I suggest you open a track with SAS Tech Support if you haven't done so already. They are in the best position to help. This will likely require investigation and tweaking of your NLS settings and running a bunch of tests. I wouldn't be surprised if the Universal Viewer simply doesn't support DBCS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@SASKiwi , thank you so much.
I guess this is caused by incompatibility between SAS universal viewer and DBCS in xpt files. Because when I use SAS to open the xpt file with messy codes, the SAS will run PROC COPY to convert xpt file back to SAS dataset whose chinese words look fine. BTW, there is no problem when SAS datasets with chinese words are opened by SAS universal viewer.
May I ask a silly question? How to open a track with SAS Tech Support? ☺
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Add the output from proc setinit so they have a copy of the site's license.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Zoe_Steven - Here is the link to open a Tech Support track
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
We'd need to see your code to comment further.
Have read this paper Tips and Fixes for Cross-Environment Batch Transfer of SAS® Data and the links in it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ChrisNZ , thank you for your reply.
Please see below for the code I used. I guess this is caused by incompatibility between SAS universal viewer and Chinese words in xpt files. Because when I use SAS to open the xpt file with messy codes, the SAS will run PROC COPY to convert xpt file back to SAS dataset whose chinese words look fine. BTW, there is no problem when SAS datasets with chinese words are opened by SAS universal viewer.
libname _sas_ "&saspath";
libname xptout xport "&xptpath.\adsl.xpt";
data adsl;
set _sas_.adsl;
run;
proc copy in=work out=xptout memtype=data;
select adsl;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is the answer that I got from SAS support tracking:
SAS Universal Viewer supports XPT format with English data. However, data that includes Asian characters is not displayed correctly. There is no workaround for this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the update,
If this is linked to this UNote, the issue is many years old, and "A fix for this issue is planned for a future software release." 💀
You could ask them when it is planned for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Zoe_Steven - AFAIK, the Universal Viewer is regarded as legacy software (along with quite a lot of older SAS products) so I wouldn't be holding my breath regarding any fixes or updates. SAS has advanced a lot in NLS but legacy products stay as they are often due to lack of demand.