Desktop productivity for business analysts and programmers

how to capture a value from data set to Footnote through Wizard

Reply
Contributor
Posts: 25

how to capture a value from data set to Footnote through Wizard

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,
N/A
Posts: 0

Re: how to capture a value from data set to Footnote through Wizard

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.
Contributor
Posts: 25

Re: how to capture a value from data set to Footnote through Wizard

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
SAS Super FREQ
Posts: 8,716

Re: how to capture a value from data set to Footnote through Wizard

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
Contributor
Posts: 25

Re: how to capture a value from data set to Footnote through Wizard

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,
SAS Super FREQ
Posts: 8,716

Re: how to capture a value from data set to Footnote through Wizard

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
Contributor
Posts: 25

Re: how to capture a value from data set to Footnote through Wizard

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.
Ask a Question
Discussion stats
  • 6 replies
  • 151 views
  • 0 likes
  • 3 in conversation