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

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
Fluorite | Level 6
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
Fluorite | Level 6

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
Fluorite | Level 6

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

Eileen1496
Fluorite | Level 6

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 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
  • 8 replies
  • 368 views
  • 0 likes
  • 3 in conversation