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

Hi all,

I have been using the following code to access WRDS server through local SAS installation for almost two years.

/*remote sign on to WRDS*/
%let wrds = wrds-cloud.wharton.upenn.edu 4016;
options comamid=TCP remote=WRDS;
signon username={myusername} 
password="{my encoded wrds password}"; 

and it was working fine until today when I got this error message:

 

NOTE: The client session encoding shift-jis does not match the server session encoding utf-8.
This may produce errors when moving some character data. Search "SAS/CONNECT Encoding
Compatibility" for details.

 

The problem seems to be that the encoding of my local SAS session is not utf-8 and thus the access was unsuccessful. But I didn't change encoding at all and no idea why this issue suddenly pops up after everything has been fine for a long time. My thinking is that i just need to change the encoding of my local SAS to utf-8. I am not sure how to do it however, and if someone could guide me how to solve this issue, I would be grateful.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

On my machine when I hit the windows key on the keyboard and start typing SA it normally shows the icon to start SAS with English as the "best match".

Tom_2-1692566269995.png

If I finish type SAS then it shows more choices:

Tom_3-1692566316146.png

 

My guess is that for some reason it has decided that you like to use SAS 9.4 (Japanese)  instead of SAS 9.4 (Unicode Support).

 

If you right click on one of the SAS icons you should be able to have it show you the file location.

That will open File Explorer.  Should look something like this:

Tom_0-1692565873604.png

So if you have the same choices make sure you are picking the one that says Unicode Support and not the Japanese one or the DBCS one.

If that does not help then right click on the one you are using and select properties.  You should see something like:

Tom_1-1692566046229.png

Copy the value of the TARGET setting.  Should look something like:

 

"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg"

If that is what is says then check the contents of that particular sasv9.cfg file.

 

 

 

View solution in original post

10 REPLIES 10
ChrisHemedinger
Community Manager

You should have a shortcut in your local SAS installation that shows "SAS 9.4 (Unicode)" or similar. This is really just a shortcut to SAS.exe with a config file option that points to the ../u8/sasv9.cg file, which in turn contains the -ENCODING UTF8 option and a few other settings.

 

I don't know if the WRDS environment changed recently or if you've just gotten away with something different up to now.

BranManderly34
Obsidian | Level 7

Hi Chris,

I checked the configuration line in "C:\Program Files\SASHome\SASFoundation\9.4\sasv9.cfg" and it seems that it is correctly configred to encode in utf8. This is the line in the file: -config "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg"

 

But if I run 

proc options option=encoding;
run;

the output shows

proc options option=encoding;
run;

SAS (r) Proprietary Software Release 9.4 TS1M4

ENCODING=SHIFT-JIS

 

Sometime last year, I was setting up SASPY, and if I remember correctly, I did change the encoding to wlatin1. But I have never heard or seen this SHIFT-JIS. Any idea what might be causing the problem? I contacted my department IT team and said they didn't change anything either.

ChrisHemedinger
Community Manager

Can you check the contents of that u8/sasv9.cfg file? You should see lines like:

 

-DBCS 
-LOCALE en_US
-ENCODING UTF-8

Also try this to see how the ENCODING value is set:

 

proc options option=encoding define value;
run;

 

This will yield details like:

Option Value Information For SAS Option ENCODING
    Value: UTF-8
    Scope: SAS Session
    How option value set: Config File
    Config file name:
            C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg
BranManderly34
Obsidian | Level 7

Hi Chris,

This is what I see on my side

BranManderly34_0-1692280625562.png

It does seem to be set into UTF-8 mode? But, when I run

 

 
proc options option=encoding define value;
run;

I get this output

 

 

Option Value Information For SAS Option ENCODING
    Value: SHIFT-JIS
    Scope: SAS Session
    How option value set: Config File
    Config file name:
            C:\Program Files\SASHome\SASFoundation\9.4\nls\1d\sasv9.cfg

I really have no idea why it points to 1d folder instead of u8. Thanks for your help.

 

 

ballardw
Super User

Helps not to post PICTURES of text so we could copy and paste text.

 

Look at the picture in the line that starts -SET SASCFG especially at the letters after NLS

 

Then compare the whole line to that

 C:\Program Files\SASHome\SASFoundation\9.4\nls\1d\sasv9.cfg

Not the same file.

So your install is using a different configuration file than you looked at

BranManderly34
Obsidian | Level 7

Hi, thanks, your point not to post pictures is noted.

I looked at the contents of C:\Program Files\SASHome\SASFoundation\9.4\nls\1d\sasv9.cfg, and the following is what I see

-FONTSLOC C:\WINDOWS\Fonts
-SET MYSASFILES "?FOLDERID_Documents\My SAS Files\9.4"
-SASUSER "?FOLDERID_Documents\My SAS Files\9.4"
-WORK "!TEMP\SAS Temporary Files"
-MEMSIZE 2G
-SORTSIZE 1G
-SET SASCFG "C:\Program Files\SASHome\SASFoundation\9.4\nls\1d"
-DBCS 
-LOCALE ja_JP
-TEXTURELOC !SASROOT\common\textures
-SET SAS_NO_RANDOM_ACCESS "1"
-ENCODING shift-jis
-IMLPACKAGEPRIVATE "?FOLDERID_Documents\My SAS Files\IML\Packages"
-IMLPACKAGEPUBLIC "?FOLDERID_ProgramData\SAS\IML\Packages"
-IMLPACKAGESYSTEM "!SASROOT\iml\sasmisc\packages"
-SET SASAML !SASROOT\share\sasmacro

In this file, the encoding is indeed set to shift-jis. If I change it to utf-8, the problem I have now would supposedly be solved? If so, could you help me with how to change the encoding back to utf-8?  

Tom
Super User Tom
Super User

You need to drill down in to how you are starting SAS to see why you are starting with that other config file.

 

So how did you launch SAS?

Did you type sas or sas.exe at the command line?

Did you click on some Icon on your desktop of the "Start" menu?

Did you click on SAS program file and let Windows magically try to figure out what program to run to use it?

Some other way?

 

Most likely the config file is being picked based on some Environment setting that indicates the language or the locale and you have recently somehow convinced Windows that you need to use Japanese.

 

But it is possible you are just accidentally starting SAS differently. 

Perhaps you have change the Windows associations to default to a different thing than before.

Perhaps you are using the same ICON in the STart menu, but its properties have been modified to point to that other configuration file.

BranManderly34
Obsidian | Level 7

Hi Tom,

There was definitely no change in how I am starting SAS. I simply click on the desktop icon like I have always done. Just one or two days before this problem came up, I received a notice about my WRDS account about to expire and the need to extend license. After I extended the license, I had to change the password, and subsequently also had to change password encoding (as seen in the top of this page). Thereafter, I am unable to access WRDS server since this encoding conflict problem showed up. Although I have limited knowledge on software, I am confused why changing WRDS password and encoding would (apparently) cause a change in encoding conflict. 

Tom
Super User Tom
Super User

On my machine when I hit the windows key on the keyboard and start typing SA it normally shows the icon to start SAS with English as the "best match".

Tom_2-1692566269995.png

If I finish type SAS then it shows more choices:

Tom_3-1692566316146.png

 

My guess is that for some reason it has decided that you like to use SAS 9.4 (Japanese)  instead of SAS 9.4 (Unicode Support).

 

If you right click on one of the SAS icons you should be able to have it show you the file location.

That will open File Explorer.  Should look something like this:

Tom_0-1692565873604.png

So if you have the same choices make sure you are picking the one that says Unicode Support and not the Japanese one or the DBCS one.

If that does not help then right click on the one you are using and select properties.  You should see something like:

Tom_1-1692566046229.png

Copy the value of the TARGET setting.  Should look something like:

 

"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg"

If that is what is says then check the contents of that particular sasv9.cfg file.

 

 

 

BranManderly34
Obsidian | Level 7
Hi Tom,
This definitely worked. Weirdly enough, the shortcut on the desktop was changed to the one with DBCS instead of Unicode. After changing to Unicode, everything is back to normal. Thanks!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 443 views
  • 3 likes
  • 4 in conversation