Building a Web Application with SAS Stored Processes |
Welcome Page |
To execute the SAS Stored Process Web Application, enter the application's URL in the Web browser. Either the default Welcome page or static data is displayed.
Here is an example of a URL for the SAS Stored Process Web Application:
http://yourserver.com:8080/SASStoredProcess/do
In this example, if the Welcome.jsp file is installed, then the Welcome page is displayed. The Welcome page might look like this one:
The Welcome page contains the following links:
Click this link to display a page of stored process samples that are installed with the SAS Web Infrastructure Platform.
Click this link to display a page that contains a tree view of folders and stored processes. You can select a stored process in the tree view in order to run the stored process. For more information, see Tree View. If there are no parameters or input forms, then the stored process will execute immediately and the results will be displayed. If there are parameters or input forms, then you will be taken to the custom input form or prompt page.
In the preceding example, if neither the Welcome.jsp file nor the Welcome.html page has been installed, then static data is displayed. The static data might look like this:
Stored Process Web Application Version 9.2 (Build 387)
Instead of navigating through this interface from the Welcome page, you can also use the _ACTION and _PROGRAM variables in the URL to open different pages. For more information, see Using Reserved Macro Variables.
Tree View |
You can access the tree view of stored processes by appending the _ACTION variable with a value of INDEX (_ACTION=INDEX) to the SAS Stored Process Web Application URL. On the left, the tree view displays the same list of folders and stored processes that you see if you click List Available Stored Processes on the Welcome page. However, in this case, when you click on a stored process in the tree view, the default action is to display the summary page for that stored process.
You can use the _PATH variable with _ACTION=INDEX to control what level the tree view begins with. For example, if you specify _PATH=/Products/SAS Intelligence Platform/Samples on the SAS Stored Process Web Application URL, then the Samples folder will be at the top of the tree view.
The keywords properties, form, and execute can be added to the _ACTION variable to control if the summary page is displayed when you select a stored process as shown in the following examples:
displays the prompt page (if available) instead of the summary page for the stored process.
displays the custom input form (if available). Otherwise, the stored process will execute.
Stored Process Summary Page |
To display the summary page for a stored process, specify _ACTION=DATA&_PROGRAM=<stored-process-path> on the SAS Stored Process Web Application URL. (You can also add _ACTION=INDEX to the SAS Stored Process Web Application URL and then select a stored process in order to display this page.)
The following items are included on this page:
specifies the location of the SAS folder that contains the stored process. You can use this path as the value for the _PROGRAM variable. For more information, see Using Reserved Macro Variables.
specifies the source code repository, where the SAS code is located.
specifies the name of the file that contains the SAS code.
specifies the type of server that is used to run the stored process (either a stored process server or a workspace server).
specifies the date and time that the stored process metadata was first registered.
specifies the date and time that the stored process metadata was last modified.
specifies any keywords that are associated with the stored process. These keywords are part of the stored process metadata.
contains a description of the stored process. This description is part of the stored process metadata.
To run the stored process, click Run at the bottom of the summary. If there are no parameters or input forms, then the stored process will execute immediately and the results will be displayed. If there are parameters or input forms, then you will be taken to the custom input form or prompt page.
Custom Input Form |
If you want the SAS Stored Process Web Application to display a custom input form for a stored process, then you can use any of the following methods:
On the Welcome page, click the Stored Process Samples link to display a page of stored process samples that are installed with the SAS Web Infrastructure Platform. Each of these samples has a link and a description. Click any of these links to display the custom input form for that stored process.
Use the _PROGRAM variable along with _ACTION=FORM in the URL to display the custom input form for a stored process. For more information, see Specifying Custom Input Forms.
Select a stored process from the tree view. If the stored process has a custom input form, then it will be displayed.
A custom input form might look like this:
You can use the custom input form to execute the stored process. In this example, clicking Display SAS Output generates the following results:
Prompt Page |
In order to display the prompt page for a stored process, you can do one of the following:
Use the _PROGRAM variable along with _ACTION=PROPERTIES in the URL to display the prompt page for a stored process. For more information, see Specifying Prompt Pages.
Select a stored process from the tree view. If the stored process has parameters but does not have a custom input form, then the prompt page will be displayed.
Note: If a stored process does not have any parameters, then it does not have a prompt page. If you click a stored process that does not have a prompt page or a custom input form, then the stored process is immediately executed.
If you have defined parameters groups, then the groups are shown as items in the menu on the left side of the prompt page. You can click each group name to display the parameters that are in that group. A prompt page without groups might look like this:
This sample prompt page shows an example of a date range type parameter. Parameters must be defined in the stored process metadata in order for them to be visible in a prompt page. Parameters are called prompts in SAS Management Console. The stored process metadata is where the name, label, type, default value, and any constraints for a prompt are defined. Constraints help define which values are allowed for a prompt, how many values are allowed, and so on.
The prompt type determines how that parameter is displayed in the prompt page. You can have any of the following types of prompts in this page:
Text
Text range
Numeric
Numeric range
Date
Date range
Time
Time range
Timestamp
Timestamp range
Color
Data source
File or directory
Data library
For more information about how to create prompts and the constraints that can be specified for each type of prompt, see the help for prompts in SAS Management Console. For more information about how to specify values for prompt, and macro variables that are generated by prompts, see Formatting Prompt Values and Generating Macro Variables from Prompts.
Execution Options |
Execution options are delivered as a sample shared prompt group that you can add to a stored process for use with the prompt page. Execution options are prompts that enable you to specify the graphic device, ODS destination, ODS style, and debugging options for a stored process at run time.
To add execution options to a stored process, perform the following steps:
Open the Stored Process Properties dialog box for the stored process and click the Parameters tab.
Select Add Shared.
Under SAS Folders, navigate to /Products/SAS Intelligence Platform/Samples.
Select Execution Options.
Click OK.
The following table contains a list of the execution options and the SAS macro variables that they represent:
Execution Option | SAS Variable Name (Prompt Name) |
---|---|
Graphic device | _GOPT_DEVICE |
Output format | _ODSDEST |
ODS style | _ODSSTYLE |
Debug options | _DEBUG |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.