Hi Guys,
I have an excel file that has many lines with date < x, or date > x or variable1 > 59 etc. This is all in excel concatenate function.
=CONCATENATE("(a<=6)","hello")
When I read this excel file using xlsx libname engine, I get " (a<=6)hello "
Is there a way around this.
Thanks,
Hi SP_SAS
The htmldecode function works here. It gived an ugly warning, but it does the decoding:
data _null_;
a = " (a<=6)hello ";
b = htmldecode(a);
put b;
run;
114
115 data _null_;
116 a = " (a<=6)hello ";
WARNING: Apparent symbolic reference LT not resolved.
117 b = htmldecode(a); put b;
118 put b;
119 run;
(a<=6)hello
How about this?
%let LT=<;
Do you want the text of the formula or the resolved value?
If the later it may be easier to export the sheet as CSV and read that file.
Resolved Value.
Hi SP_SAS
The htmldecode function works here. It gived an ugly warning, but it does the decoding:
data _null_;
a = " (a<=6)hello ";
b = htmldecode(a);
put b;
run;
114
115 data _null_;
116 a = " (a<=6)hello ";
WARNING: Apparent symbolic reference LT not resolved.
117 b = htmldecode(a); put b;
118 put b;
119 run;
(a<=6)hello
Thanks.. That is a good work around..
The warning comes from the way you created your string.
a = ' (a<=6)hello ';
yields no warning.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.