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-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 677 views
  • 0 likes
  • 2 in conversation