BookmarkSubscribeRSS Feed
vraj1
Quartz | Level 8

I have a footnote "%s: percentage of successful attempts".

 

if i use %nrstr(&footnote.) where footnote sontains "%nrstr(&footnote.)"

 

i get the following warning.

WARNING: Apparent invocation of macro S not resolved.

 

How can i mask this

6 REPLIES 6
Reeza
Super User

Use single quotes instead of double is a quick way.

 

In single quotes SAS won't try and resolve the macro, in double quotes it would. If you also needed to include a macro variable in your footnote this wouldn't work. 

vraj1
Quartz | Level 8

It was not in quotes for example:

 %put footnote           = <%nrstr(&footnote.)>;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

So, can you provide some example of what it is your doing.  Why have the footnote in a macro variable, normally there would be lots of footnotes, so easier to store them in a dataset, then call it from there:

data _null_;
  set footnotes;
  call execute(cat('footnote',strip(put(_n_,best.)),' j=l "',strip(footnote),'";'));
run;
vraj1
Quartz | Level 8

I have a dataset which has all footnotes for each table and importing the dataset for each particular program and calling them

call symput('footnote',%nrbquote(strip(footnote))); in the datastep then i am using %put footnote           = <%nrbquote(&footnote.)>; 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, so you could try the datastep I provided above, to simply generate the statements from the datastep - avoid all the macro variables and other processing.

Tom
Super User Tom
Super User

Can you post actual SAs code that replicates the error message?  It is unclear if you are talking about the FOOTNOTE statement or the creation of a macro variable named FOOTNOTE or expanding the reference to a macro varaible named FOOTNOTE.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 6 replies
  • 1317 views
  • 2 likes
  • 4 in conversation