Desktop productivity for business analysts and programmers

SAS Enterprise Guide to point to Unicode SAS

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

SAS Enterprise Guide to point to Unicode SAS

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.

Accepted Solutions
Solution
‎01-12-2018 12:30 AM
Valued Guide
Posts: 530

Re: SAS Enterprise Guide to point to Unicode SAS

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


All Replies
Super User
Posts: 9,560

Re: SAS Enterprise Guide to point to Unicode SAS

Get in contact with your SAS server admin(s), so that your SAS backend is configured to work with UTF-8 globally.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Valued Guide
Posts: 530

Re: SAS Enterprise Guide to point to Unicode SAS

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.

Occasional Contributor
Posts: 15

Re: SAS Enterprise Guide to point to Unicode SAS

Posted in reply to jklaverstijn

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!

 

Solution
‎01-12-2018 12:30 AM
Valued Guide
Posts: 530

Re: SAS Enterprise Guide to point to Unicode SAS

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.

Super Contributor
Posts: 292

Re: SAS Enterprise Guide to point to Unicode SAS

Posted in reply to jklaverstijn

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

 

proc options option=encoding value;
run;
Occasional Contributor
Posts: 15

Re: SAS Enterprise Guide to point to Unicode SAS

Yes, I found I know the encoding but I don't know how to change the encoding.
Occasional Contributor
Posts: 15

Re: SAS Enterprise Guide to point to Unicode SAS

Posted in reply to jklaverstijn

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!




☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 540 views
  • 3 likes
  • 4 in conversation