Hello SAS guys,
When I import the excel file into SAS, the SAS dataset has some special charater string beginning with &#, which the excel file don't have, such as " " ,"&# 8875;", "’". How can I delete those unwanted strings. It seems there is nothing strange with excel file, however these special string shows up between the space of two words instead of blank space. Any idea is appreciated.
my SAS data is :
var1
Newton’s seconde law for particles
Newtow’s first law for particales
Region 1
13. Basic Math
4.Instruction and#&8875; Concepts
7.Vibratons#&8875;knowledge
What method did you use to import the data? What version of SAS are you using.
I think this issue of some unicode characters being stored this way was fixed in a recent update.
You can just use TRANWRD() function to convert them.
160 (or 'A0'x) is a "non-breaking" space. So just replace it with a space.
8217 is a curly single quote. I would just replace it with a normal single quote.
Hi Tom,
I use SAS 9.4(TS1M3). The import code is proc import datafile="datadir\excelfilename.xlse" out=have dbms=xlsx replace;
getnames=no;
run;
Thanks for answering the question
Thank you Cynthia_sas. How can I convert the excel file to a unicode font? The format cells option in excel do not provide unicode choice.
Thank you very much. It works.
data _null_;
x='Newton’s seconde law for particles';
x=htmldecode(x);
put x=;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.