BookmarkSubscribeRSS Feed
deleted_user
Not applicable
H i

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

Regards.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 1833 views
  • 0 likes
  • 2 in conversation