If you have a SAS® Stored Process that creates non–streaming output and you submit the SAS Stored Process using a Web browser, you can run the request in the foreground (the default) or in the background. Here are some notes about running a SAS Stored Process in the background using SAS® 9.2 and later releases.
Multiple values for the _ACTION= parameter are separated by a comma, as in the following example:
http://your-server:8080/SASStoredProcess/do?_program=/MySTPs/test&_action=strip,background
2. If the SAS Stored Process has input parameters that require end user selections before submitting the SAS Stored Process, you can define _ACTION=BACKGROUND as a hidden input parameter for the SAS Stored Process definition in metadata. Note: the metadata–defined _ACTION=BACKGROUND hidden parameter is only used if the SAS Stored Process is submitted using the Property page supplied by SAS. In other words, this approach requires that there be other visible input parameters defined in metadata that the end user must select before running the SAS Stored Process.
For example, create a SAS Stored Process with two input parameters. One parameter is _action (NOTE: the name of the parameter, _action, must be specified in LOWER CASE) with default value of BACKGROUND (case insensitive) and the checkbox to "Hide from user" selected and the other parameter is AGE with values from 11 to 16 in a static list. The SAS Stored Process code is:
%stpbegin;
proc print data=sashelp.class;
where age=&age;
run;
%stpend;
When this SAS Stored Process is submitted from the SAS Property page, it will be executed in the background.
3. If the SAS Stored Process does not require user interaction for input parameter selection, you can create a custom jsp file that automatically submits the SAS Stored Process with _ACTION=BACKGROUND, as in the following example:
<html><body onLoad="document.mystp.submit()"> <form name=mystp action="<%= request.getContextPath() %>/do"> <input type="hidden" name="_program" value="/MySTPs/test"> <input type="hidden" name="_action" value="background"> </form></body></html>
3. Running a SAS Stored Process in the background causes an alert to be created. You can view your alerts (and any results from the SAS Stored Process) from the Stored Process Alerts Portlet in the SAS® Information Delivery Portal.
4. In the SAS Information Delivery Portal, the following portlets are helpful when running SAS Stored Processes in background mode.
Follow these steps to add the Stored Process Alerts Portlet to your SAS Information Delivery Portal Page:
You can use the Personal Repository Navigator to access your Personal Repository (which resides on the SAS Content Server).
Follow these steps to add the Personal Repository Manager to your SAS Information Delivery Portal Page:
3. The WebDAV Navigator
Follow these steps to add the WebDAV Navigator to your SAS Information Delivery Portal page:
5. When the SAS Stored Process is submitted, a message is returned to the browser window stating:
Stored Process <stored process name> submitted for background processing.
6. When the SAS Stored Process competes execution, the following items occur:
Then, select your *.spk output file, save it as a *.zip file and open it with a utility such as WinZip.
7. For more information, see the following resources: