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.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 7 replies
  • 823 views
  • 2 likes
  • 5 in conversation