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

Hi all,

 

I got a 4gb SAS dataset with company information. The company name column is very important to me. However, I found though most of the observations are in normal format, e.g. "Birly Co", there are many rows has values like "ÃÂ". Do you know if this is a problem in the original dataset that I cannot solve as a data user, or it is a problem of encoding on my computer?  

I actually tried encoding it to utf-8 or utf-16le, utf-16be in python, but still I got such weird characters.

 

Thank you!

1 ACCEPTED SOLUTION
8 REPLIES 8
Eileen1496
Obsidian | Level 7
Hi Kurt, what do you mean by "session encoding"? I tried utf-8, utf-16le,
utf-16be in python. In sas I just open the file directly because it is
originally in sas7bdat format. And it also shows the abnormal chars.
Eileen1496
Obsidian | Level 7

Hi Kurt! It return the following to me:

SAS (r) Proprietary Software Release 9.4 TS1M6

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

 

Should I change anything so this problem can be fixed?

 

Eileen1496
Obsidian | Level 7

Dear Kurt, thanks for pointing out the problem! I would never realize that alone probably, I will talk with them.

Eileen1496
Obsidian | Level 7

Dear Kurt, thanks for pointing out the problem! I would never realize that alone probably, I will talk with them.

GPatel
Pyrite | Level 9

You can try :

Suppose your abnormal characters in SAS file is in "Comments" column/field. 

Use code below to remove/replace weird/abnormal characters.

 

Comments=KCVT(compress(Comments,,'kw'), 'wlatin1', 'UTF-8');
or

Comments =compress(Comments, , 'kw');

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1506 views
  • 0 likes
  • 3 in conversation