BookmarkSubscribeRSS Feed
sowmyavasa
Calcite | Level 5

Hello,

I have a text string like this : 'UNIT: 10^3/UL’. and it should be converted to ‘UNIT: 10^3/UL’.

The first apostrophie should be changed from " 'UNIT " to " ‘UNIT"

Please let me know how to do this?

Thanks,

Sowmya

4 REPLIES 4
sowmyavasa
Calcite | Level 5

Yes, But I dont know the ASCII code for the quote that is mentioned. Both appears to be same ?

ChrisNZ
Tourmaline | Level 20

Not the same. Look closer.

You can get the code using function rank().

data HAVE;

  X="  'UNIT: 10^3/UL’  ";

  X=translate(X,"’","'");

  A=rank("’");

  B=rank("'");

  put X= / A= B=;

run;

X=’UNIT: 10^3/UL’

A=146 B=39

RW9
Diamond | Level 26 RW9
Diamond | Level 26

My question would by why do you want quotes of any kind in your data, just looks like extra effort for no gain.  If it needs to be quoted for output purposes then use the quote functions provided, but keep your raw data without these things.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3862 views
  • 1 like
  • 4 in conversation