SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Zoe_Steven
Calcite | Level 5

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. 
Messy code in XPT file.png

 

 

 

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

14 REPLIES 14
SASKiwi
PROC Star

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.

Zoe_Steven
Calcite | Level 5

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.

SASKiwi
PROC Star

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

Zoe_Steven
Calcite | Level 5

@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? ☺

ChrisNZ
Tourmaline | Level 20
Send an email to SUPPORT at SAS dot COM.
Add the output from proc setinit so they have a copy of the site's license.
Zoe_Steven
Calcite | Level 5
Okay, thank you. I've contacted SAS SUPPORT
Zoe_Steven
Calcite | Level 5

@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;
Zoe_Steven
Calcite | Level 5

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.

ChrisNZ
Tourmaline | Level 20

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.

SASKiwi
PROC Star

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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 14 replies
  • 13670 views
  • 1 like
  • 3 in conversation