BookmarkSubscribeRSS Feed
lik66
Calcite | Level 5

Hi,

 

I am having an issue with a datasets with some coding issues. 

 

I am seeing "&#xA;", "&#x9;" , "<U+00A0>" and "&deg;" in some free text fields. Currently I am using a macro to exclude or replace these special characters. 

 

Then checked the encoding for the dataset and the sas session (I'm  using sas studio). For the session, I see "ENCODING=LATIN1 Specifies the default character-set encoding for the SAS session." and for the dataset "ENCODING is wlatin1 Western (Windows)".  I'm wondering if it is because the encoding is not matching so these control characters are not translated properly.

 

I tried using encoding= Windows-1252 but I don't seem to find a way to set my sas session in wlatin1 in sas studio. Is there a way to set it in wlatin1? Or if there is another route to translate these control characters (eg. line feed) and special characters (eg. degree symbol)?

 

Thank you!

 

 

1 REPLY 1
Tom
Super User Tom
Super User

The SESSION encoding (what you see in the ENCODING system option) has to be set when SAS starts.

So to change that you would need to get your SAS admin to create a application server using a different session encoding and connect to that application server with SAS/STudio instead of the one you are using.

 

If you have to work with multiple text sources you are probably going to be better off just moving directly to Unicode support. Encoding=UTF-8 instead.  Any single byte encoding is going to be limited to 256 different characters.

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
  • 1 reply
  • 377 views
  • 0 likes
  • 2 in conversation