DATA Step, Macro, Functions and more

macro code for titles and footnotes in report

Reply
N/A
Posts: 0

macro code for titles and footnotes in report

H i

could u tell me what is the macro code for titles and footnotes in report generation.

Regards.
SAS Super FREQ
Posts: 8,868

Re: macro code for titles and footnotes in report

Posted in reply to deleted_user
Hi:
I'm not sure what you mean by macro code for titles and footnotes. SAS has some automatic macro variables that it creates and which you can use in a SAS title (or footnote) statement:
[pre]
ods listing;
proc print data=sashelp.class;
title "Report Created on: &SYSDATE";
run;
[/pre]

Depending on your time zone, when you run the above program, you should get a title in the output with the date supplied by the value for the automatic &SYSDATE macro variable. For example:
[pre]
Report Created on: 15APR08
[/pre]

For more information about the automatic macro variables, look in the Macro facility documentation for these topics:
Macro Language Elements --> Automatic Macro Variables

On the other hand, I could make my own macro variable or macro variables to be used in a title -- so this code creates some macro variables:
[pre]
%let myfave = Kermit;
%let myshow = Sesame Street;
[/pre]

and now I want to use them:
[pre]
ods listing;
proc print data=sashelp.class;
title "My favorite Muppet is: &myfave";
title2 "On the &myshow show";
run;
[/pre]

which results in:
[pre]
My favorite Muppet is: Kermit
On the Sesame Street show
[/pre]

For more help on using Macro variables, you could read the Macro facility documentation. In addition, you could consult with Tech Support for help with a particular title or footnote need.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 213 views
  • 0 likes
  • 2 in conversation