BookmarkSubscribeRSS Feed
anandbillava
Fluorite | Level 6

Dear forum experts

In our data we are getting unicode characters of some DBCS characters. for e.g the symbol for mu is converted as μ . We are having lot of such characters in our RDE data.

We are not sure how we should handle these texts. These are important characters and we do not know how to process them.

Please let me know.

Please check the screenshot also.

Thanks for your help.

Anand


screenshot.jpg
4 REPLIES 4
Reeza
Super User

How do you want them handled? Do you want them stripped out? Read in and displayed as mu?

anandbillava
Fluorite | Level 6

Thanks Reeza. I did stripped those characters. But we came to know that these are required and we have to convert them back to their actual values.

KarlK
Fluorite | Level 6

Well, I'm a little confused by the representation of the unicode characters that you're seeing, but I'll offer my 2 cents. The format "&#n;" is, in the unicode world, called the "numeric character representation" or NCR, where "n" is a number, and the other characters are literal. In your screenshot, I'm afraid I don't know what the leading "/" or the trailing "l" are for. In any event, you should be able to  strip out those characters, and then convert what's left with the SAS unicode() function. Here's an example:

data one;

input wbc wbcoth_uni $;

wbcoth = unicode(wbcoth_uni,'ncr');

datalines4;

3690 μ

;;;;

run;

When I open the table "one" in ViewTable, I see a mu in the wbcoth column. Please note that you do need to be running the unicode version of SAS, which may not be the default at your institution. On my Windows system, it's in the start menu-->All Programs-->SAS-->Additional Languages-->SAS 9.3 (unicode support).

HTH

Karl

Ksharp
Super User

Check some options :

infile x  encoding=dbcs recft=    termstr=  

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 4 replies
  • 1106 views
  • 0 likes
  • 4 in conversation