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
SAS Super FREQ
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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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