In my last post I talked about creating a simple stored process that could be used to run any macro. So, for example, if you had lots of reports and wanted to make them avaiable from the Stored Process Server you need not create a distinct stored process for each one.
Create a stored process in an appropriate folder (more on this in later posts) and define the following three parameters:
- macroToRun: the name of the macro that is to be run. Make this a required parameter.
- _odsDest: the ODS Destination (e.g., HTML, PDF, RTF, and so on). Make this a required parameter and give it a default value.
- _odsStyle: the ODS Style to use. This is an optional parameter as SAS will use a default style if not specified.
%put NOTE: Execute macro ¯oToRun..;
When this stored process is executed any values provided in the HTML form or hyperlink are available to the stored process and, thus, to the macro code. So presuming you specify myReport as the value of macroToRun, the SAS wordscanner will parse
and resolve it to:
which will run your report macro assuming the path where it is located is defined to the Stored Process Server (and that will be the subject of an upcoming post).