Usage Note 39114: Tips for running a SAS® Stored Process in Background mode
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.
- By default, a SAS Stored Process runs in the foreground
and your Web browser will wait to receive the output until the SAS Stored Process
completes execution. However, if you run a SAS Stored Process in the
background, control is returned to your Web browser when the
SAS Stored Process is submitted for execution.
- To execute the SAS Stored Process in background mode, you must add the _ACTION=BACKGROUND option to the SAS Stored Process execution using one of the following approaches:
- Add the _ACTION=BACKGROUND option directly to the URL for the SAS Stored Process. For example:
http://your-server:8080/SASStoredProcess/do?_program=/MySTPs/test&_action=background
Multiple values for the _ACTION= parameter are separated by a comma, for example:
http://your-server:8080/SASStoredProcess/do?_program=/MySTPs/test&_action=strip,background
- 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 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.
- 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. For 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>
- 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.
- In the SAS Information Delivery Portal, the following
portlets are helpful when running SAS Stored Processes in
background mode.
- The Stored Process Alerts Portlet
Follow these steps to add the Stored Process Alerts Portlet to your SAS Information Delivery Portal Page:
- Select Options>Edit Page Content>Add Portlets.
- On the Add Portlets page, click Search and search for the Stored Process Alerts Portlet.
- Check the Stored Process Alerts Portlet box.
- Click Add and then click Done and OK.
- The Personal Repository Navigator.
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:
- Select Options>Edit Page Content>Add Portlets.
- On the Add Portlets page, click Search
and search for the Personal Repository Navigator.
- Check the Personal Repository Navigator box.
- Click Add and then click Done and OK.
- The WebDAV Navigator
Follow these steps to add the WebDAV Navigator to your
SAS Information Delivery Portal page:
- Select Options>Edit Page Content>Add Portlets.
- Under the Portlet type pulldown, select WebDAV Navigator.
- Click Add and then click Done and OK.
- 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.
To change this message, you can create a Background.jsp file with custom text. See the Custom Responses for more information.
- When the SAS Stored Process competes execution, the following items occur:
- An alert message is added in the Stored Process Alert Portlet. You can click on the alert message to see your output.
- The output is stored on the SAS Content Server at:
/sasdav/Users/<user name>/PR/MyDocuments
- You can also access your output via a Web browser outside of
the SAS Information Delivery Portal. For example using your Web browser, reference an
address similar to the following (where you specify your
site–specific Web server and user account):
http://your-server:8080/SASContentServer/repository/default/sasdav/Users/<user name>/PR/MyDocuments
Then, select your *.spk output file, save it as a *.zip
file and open it with a utility such as WinZip.
- For more information see the following resources:
Operating System and Release Information
SAS System | SAS Integration Technologies | z/OS | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.2 TS2M0 | |
Windows Vista | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.2 TS2M0 | |
64-bit Enabled Solaris | 9.2 TS2M0 | |
HP-UX IPF | 9.2 TS2M0 | |
Linux | 9.2 TS2M0 | |
Linux for x64 | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.2 TS2M0 | |
Solaris for x64 | 9.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | |
Topic: | Query and Reporting
|
Date Modified: | 2010-11-01 13:34:58 |
Date Created: | 2010-03-22 14:44:25 |