BookmarkSubscribeRSS Feed
MohamedS
Obsidian | Level 7
Hi,

is there any possibility to put a dynamic variable in any report footnote by selecting a specific value from specific column and Row (i.e. based on the generated report I want to get a value from the data set and present it in footnote)?

regards,
6 REPLIES 6
deleted_user
Not applicable
Yes.

One way is with a macro variable and may require some clever programming.

Another way is if the value is part of a BY statement, then #byval(variable_name) will work.
There are some other # directives that also may be used that may work better for your situation.

The # directives work for titles and footnotes, at least that is my understanding.
MohamedS
Obsidian | Level 7
Hi Chuck,

thanks for your answer. but, I think this only valid when we write a code to generate report.
My question: what if I'm going to use wizard to create report (i.e. list report) and on that wizard I want to add on the footnote I want to add a maximum value from one of the table variables i.e. Age in SAShelp.class.

Is this achievable or not? and how?

thanks for your reply
Cynthia_sas
SAS Super FREQ
Hi:
The Wizards in EG are very powerful, so is the Parameter Manager, however, if you want to grab data from a dataset and turn it into a macro variable, then you will have to edit the code generated by the Wizard to create the macro variable.

If you know, for example, that you are going to name your macro variable &MYAGE, then inside the wizard, you could put &MYAGE in the footnote panel. However, before you ran the code from the Wizard, you'd have to insert the right statements to generate &MYAGE. I also can't remember whether the Wizard puts single quotes or double quotes around titles and footnotes...but you'd have to be sure that your footnote had double quotes around it.

The Parameter Manager allows you to specify parameters or macro variables that will be resolved (usually) by prompting the user at run time for a value. For help figuring out the bit of code you'd need to get your variable value into a macro variable, you might consider contacting Tech Support or looking at the Macro facility documenation.

cynthia
MohamedS
Obsidian | Level 7
Hi cynthia,

Then the code is a must to grab any variable value to macro then to footnote or title in the wizard. No built-in function to do that (i.e. %sysfunc() for getting some environment parameters).

regards,
Cynthia_sas
SAS Super FREQ
Now, that's a completely different question. An environment variable, to me, is something like %root or another variable that you set at the operating system level. An environment variable would NOT be a value from a data set, in my interpretation of "environment" variable. On the other hand, I could set a "SAS environment variable" in my AUTOEXEC.SAS file -- something like &PATH that would be my location for writing files.

In fact, there's a SYSGET function that allows you to get the value of an operating system environment variable. And, yet, there's no Wizard to invoke SYSGET, you would have to do that in code. %SYSFUNC, is a Macro function that allows you to invoke a data step function....so for example,
[pre]
footnote "Created on: %sysfunc(today(),mmddyy10.)";
[/pre]

would use the today() function to grab today's date and format it with the mmddyy10. format and use that value in the footnote.

The answer to your question depends on whether you want the value from a DATASET variable in your footnote or the value from an ENVIROMENT variable in your footnote. Tech Support can help you in this regard.

cynthia
MohamedS
Obsidian | Level 7
I want the value from data set. I was giving example of %sysfunc as an example of how Can I get the value of data set.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 1187 views
  • 0 likes
  • 3 in conversation