SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Hi, All:

 

 

I would like to display footnote, ***NA means "Not Applicable"***, by using PROC REPORT's Line statement, like my following code.

But this code does not generate what I want, only one period (".").

%let _foot1=NA means "Not Applicable".;
data test;
    do item=1 to 5 by 1;
        pagenum=1; output;
    end;
run;
ods rtf file="PleaseSpecifyYourOwnFolder\test.rtf";
proc report data=test style(report)={rules=groups frame=above};
    column item pagenum;
    define pagenum / order noprint;
    define item / display;
    break after pagenum / page;
    compute after _page_;
        line "&_foot1.";
    endcomp;
run;
quit;
ods rtf close;

ex.PNG

I tried to use quoting like this, ***%let _foot1=%str(NA means %"Not Applicable%".);***, but same result.

I think there may be problems about Double Quotations, because if deleting Double Quotations, i.e., using ***%let _foot1=NA means Not Applicable***, I can display what I want.

 

I have no idea, please help me.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star
As long as your post shows the actual problem and not a simplified version, I would use:

%let _foot1 = 'NA means "Not Applicable".';

Then later:

line &_foot1.;

View solution in original post

4 REPLIES 4
Astounding
PROC Star
As long as your post shows the actual problem and not a simplified version, I would use:

%let _foot1 = 'NA means "Not Applicable".';

Then later:

line &_foot1.;
KentaMURANAKA
Pyrite | Level 9

Hi, Astounding-san:

 

 

Your code worked. Wonderful.

Thank you for your kind cooperation.

ballardw
Super User

Or

 

%let _foot1=NA means ""Not Applicable"".;

 

Two quotes resolve as one in general.

So your resolution of

 line "&_foot1.";

becomes

 line "NA means ""Not Applicable"".";

So

proc report data=test style(report)={rules=groups frame=above};
    column item pagenum;
    define pagenum / order noprint;
    define item / display;
    break after pagenum / page;
    compute after _page_;
        line "NA means ""Not Applicable"".";
    endcomp;
run;

runs just fine. This use two quotes in literal text works almost anywhere in SAS code.

Such as

data work.junk;
    x="This is a string with "" embedded in a variable.";
run;
KentaMURANAKA
Pyrite | Level 9

Hi, ballardw-san:

 

 

Your answer also works greatly.

Thank you for quick response.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 4 replies
  • 1913 views
  • 3 likes
  • 3 in conversation