BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChaseLiu
Obsidian | Level 7

Hi Communities,

I Encountered some coding problems, it's weired and frustrated.

Background:

  • My SAS program is encoding in UTF-8, contains some Chinese characters, and output some charts.
  • It works well in SAS Display Manager with UTF-8 encoding and the charts also shows good.
    Capture2.PNG
  • When it comes to EG, and setting UTF-8 encoding in the session. The label in axis becomes garbled
    Capture.PNG
    I dont's know why. But I guess it is the encoding of SAS behind EG is not UTF-8.

    Does anyone has some idea in that?

    Thanks for any help on the matter.
1 ACCEPTED SOLUTION

Accepted Solutions
jklaverstijn
Rhodochrosite | Level 12

Now we must find out where the UTF-8 setting comes from. On the same workstation I would expect your DMS session to be the same SAS installation/configuration. You can check this by looking at the EG's Help --> About. Click Configuration Details and see what the value of SAS System Command is. If it contains a -config option then that option points to a file on your PC that would contain the encoding option currently in effect. Alternatively this file could include another one (with "_usermods" in its name) that sets this option. Can you have a look and paste the value in this conversation? we can then work from there.

 

Regards,

-- Jan.

View solution in original post

7 REPLIES 7
jklaverstijn
Rhodochrosite | Level 12

Check for the value of the ENCODING option in your EG workspoace server session. Submit the following code:

 

proc options option=encoding;
run;

You want this to be 

24         proc options option=encoding; run;

    SAS (r) Proprietary Software Release 9.4  TS1M4

 ENCODING=UTF-8    Specifies the default character-set encoding for the SAS session.
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

but likely you get 

 

24         proc options option=encoding; run;

    SAS (r) Proprietary Software Release 9.4  TS1M4

 ENCODING=LATIN1   Specifies the default character-set encoding for the SAS session.
NOTE: PROCEDURE OPTIONS used (Total process time):

Your SAS administrator will have to make the appropriate changes to the server configuration. This is not a trivial change if this is a server based installation as there is impact on existing data and potentially multiple users will be involved. If you are running a local server you will be the only one but still existing data sets with Latin encoding will have to be migrated or performance will be hurt. So in any case it is not a simple toggle.

 

Hope this helps,

-- Jan.

ChaseLiu
Obsidian | Level 7

Hi jklaverstijn,

Thanks very much for your kindly help.

I checked my setting in EG and it' UTF-8, and the chart label get garbled.

However, in SAS DM, the encoding is EUC-CN, and the chart label shows good.

It seems that the UTF-8 encoding in SAS EG can't encode Chinese characters correctly.

Do you know any way to change the server encoding in SAS EG? I'd like to change the encoding to EUC-CN. it's a local server.

Thank you!

 

jklaverstijn
Rhodochrosite | Level 12

Now we must find out where the UTF-8 setting comes from. On the same workstation I would expect your DMS session to be the same SAS installation/configuration. You can check this by looking at the EG's Help --> About. Click Configuration Details and see what the value of SAS System Command is. If it contains a -config option then that option points to a file on your PC that would contain the encoding option currently in effect. Alternatively this file could include another one (with "_usermods" in its name) that sets this option. Can you have a look and paste the value in this conversation? we can then work from there.

 

Regards,

-- Jan.

nhvdwalt
Barite | Level 11

Running the below will tell you where the value was loaded from. Saves a ton of time troubleshooting...

 

proc options option=encoding value;
run;
ChaseLiu
Obsidian | Level 7
Yes, I found I know the encoding but I don't know how to change the encoding.
ChaseLiu
Obsidian | Level 7

Hi jan,

I checked my config followed by the process you listed, found that the config is pointing to UTF-8 config.

C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE -config C:\PROGRA~1\SASHome\SASFOU~1\9.4\sasv9.cfg -objectserver -nologo -noterminal -noprngetlist

After that, it occures to me that I have two way to solve my problem:

  1. Change the SAS System Command that executed, pointed the -config to other language config file.
  2. Manually Change the sasv9.cfg that EG is currently pointing, set the config to other language config file

By the first solution, I followed the method from Chris Hemedinger:

You can change the registered SAS command that SAS Enterprise Guide uses in order to remove the -NOXCMD startup option. But since this involves unseemly interaction with the Windows registry, you might prefer to use a tool that does this for you. I've placed such a tool here. (It's a ZIP file that contains a program and a ReadMe.txt file with instructions.

I changed the command, but it has no effect. I don't know how.

So I switch to the second solution:

changed the sasv9.cfg the EG is currently pointing.

And it worked!

Thanks very much for your assistance!




SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 7 replies
  • 9954 views
  • 6 likes
  • 4 in conversation