- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- When it comes to EG, and setting UTF-8 encoding in the session. The label in axis becomes garbled
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Get in contact with your SAS server admin(s), so that your SAS backend is configured to work with UTF-8 globally.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Running the below will tell you where the value was loaded from. Saves a ton of time troubleshooting...
proc options option=encoding value;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Change the SAS System Command that executed, pointed the -config to other language config file.
- 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!