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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1443 views
  • 0 likes
  • 2 in conversation