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
Would the translate() function help? SAS(R) 9.4 Functions and CALL Routines: Reference, Fourth Edition
Yes, But I dont know the ASCII code for the quote that is mentioned. Both appears to be same ?
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
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.
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 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: