BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SP_SAS
Obsidian | Level 7

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&lt;=6)hello     "

 

Is there a way around this.

 

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLund_Jensen
Rhodochrosite | Level 12

Hi SP_SAS

 

The htmldecode function works here. It gived an ugly warning, but it does the decoding:

 

data _null_;
	a =  "       (a&lt;=6)hello     ";
	b = htmldecode(a);
	put b;
run;

114
115 data _null_;
116 a = " (a&lt;=6)hello ";
WARNING: Apparent symbolic reference LT not resolved.
117 b = htmldecode(a); put b;
118 put b;
119 run;

(a<=6)hello

 

 

View solution in original post

7 REPLIES 7
data_null__
Jade | Level 19

 

How about this?

 

%let LT=<;
ballardw
Super User

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.

SP_SAS
Obsidian | Level 7

Resolved Value.

 

ErikLund_Jensen
Rhodochrosite | Level 12

Hi SP_SAS

 

The htmldecode function works here. It gived an ugly warning, but it does the decoding:

 

data _null_;
	a =  "       (a&lt;=6)hello     ";
	b = htmldecode(a);
	put b;
run;

114
115 data _null_;
116 a = " (a&lt;=6)hello ";
WARNING: Apparent symbolic reference LT not resolved.
117 b = htmldecode(a); put b;
118 put b;
119 run;

(a<=6)hello

 

 

data_null__
Jade | Level 19
The warning is not from the function. The warning refers to line 116.
SP_SAS
Obsidian | Level 7

Thanks.. That is a good work around..

ChrisNZ
Tourmaline | Level 20

The warning comes from the way you created your string.

a = ' (a&lt;=6)hello ';

yields no warning.

 

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1123 views
  • 2 likes
  • 5 in conversation