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!
You will need to have a session started with utf-8 encoding to properly use the dataset. Talk with your SAS administrators how to get one.
In SAS, run
proc options option=encoding value;
run;
to see how the session encoding is set.
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?
You will need to have a session started with utf-8 encoding to properly use the dataset. Talk with your SAS administrators how to get one.
Dear Kurt, thanks for pointing out the problem! I would never realize that alone probably, I will talk with them.
Dear Kurt, thanks for pointing out the problem! I would never realize that alone probably, I will talk with them.
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(
or
Comments =compress(Comments, , 'kw');
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.
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.