SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Improving Program Efficiency with Macro Variables
Using Automatic Macro Variables


You may have noticed that the FOOTNOTE statement text that includes the macro variable reference appears in double quotes. Macro variable references that appear in quoted strings must be enclosed in double quotes.

Caution: If single quotes enclose a macro variable reference, it is not resolved by SAS software.

     title 'Temporary Employees Hired in November';
     footnote "Report Run on &sysdate";
     data hrd.tempnov;
        set hrd.temp;
        if month(begindate)=11;
     run;
     proc print data=hrd.tempnov;
     run;

Here's an example. The program below encloses the macro variable reference in single quotes. When you submit the program below, you see an unresolved macro variable reference in the footnote.

     title 'Temporary Employees Hired in November';
     footnote 'Report Run on &sysdate';
     data hrd.tempnov;
        set hrd.temp;
        if month(begindate)=11;
     run;
     proc print data=hrd.tempnov;
     run;

Report Run on &sysdate



  back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement