Hi,
I have a Stored Process Report in Web Report Studio that creates a PDF report. The person who created this report doesn't work with us anymore. The Stored Process has a prompt parameter called Filter: Male, Female, Alabama, Alaska, Arizona, etc. (50 States). All of these values are listed under a "Filter" parameter. Currently, I can select only one value and create a report in WRS. I need to select Male + Female + 50 States and create a PDF report.
Could someone help me to create a report for each of 50 states in batch? I was reading "Processing Reports Outside of SAS Web Report Studio" in SAS Knowledge Base, but can't figure out how to include parameters/stored process.
Thanks!
RS
Since a stored process is already controlled by macro variables (the prompts end up as such), you have to wrap the code into %macro something(); and %mend; insert a list of the prompt macro variables (without leading &) between the parentheses of the %macro statement.
If you want to repeatedly execute the macro from a data step, here's an example at the bottom of the page:
Depending on your environment, I suggest
- wrap the SAS code into a macro and then execute the macro for each parameter combination (you can do this in a data step, see "call execute")
- put the sas code into a .sas file, get male/female and state in the code from the OS environment (%sysget) and then write a wrapper script (UNIX: for STATE in AL ...;do;for GEN in M F; do; export STATE;export GEN;sas program.sas;done;done) to repeatedly run the code
Thanks Kurt for your input! It's Windows environment. I was trying to use "call execute" as you suggested, but I'm not sure how to include the Stored Process. It takes a lot of time and effort to run same report 50 times every day. Is there an easy way I can run it using a macro?
-RS
Since a stored process is already controlled by macro variables (the prompts end up as such), you have to wrap the code into %macro something(); and %mend; insert a list of the prompt macro variables (without leading &) between the parentheses of the %macro statement.
If you want to repeatedly execute the macro from a data step, here's an example at the bottom of the page:
Thank you, Kurt! I really appreciate your help. -RS
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.