Previous Page | Next Page

Building a Web Application with SAS Stored Processes

Using the SAS Stored Process Web Application Pages


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:

[Stored Process Web Application welcome page]

The Welcome page contains the following links:

Stored Process Samples

Click this link to display a page of stored process samples that are installed with the SAS Web Infrastructure Platform.

List Available Stored Processes

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:

_ACTION=INDEX,PROPERTIES

displays the prompt page (if available) instead of the summary page for the stored process.

_ACTION=INDEX,FORM,EXECUTE

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.)

[Stored process summary page]

The following items are included on this page:

Metadata path

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.

Source code location

specifies the source code repository, where the SAS code is located.

Source file

specifies the name of the file that contains the SAS code.

SAS server type

specifies the type of server that is used to run the stored process (either a stored process server or a workspace server).

Created

specifies the date and time that the stored process metadata was first registered.

Last modified

specifies the date and time that the stored process metadata was last modified.

Keywords

specifies any keywords that are associated with the stored process. These keywords are part of the stored process metadata.

Description

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:

A custom input form might look like this:

[Stored process custom input form]

You can use the custom input form to execute the stored process. In this example, clicking Display SAS Output generates the following results:

[Stored process results page]


Prompt Page

In order to display the prompt page for a stored process, you can do one of the following:

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.  [cautionend]

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:

[Stored process parameters page]

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:

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:

  1. Open the Stored Process Properties dialog box for the stored process and click the Parameters tab.

  2. Select Add Shared.

  3. Under SAS Folders, navigate to /Products/SAS Intelligence Platform/Samples.

  4. Select Execution Options.

  5. Click OK.

The following table contains a list of the execution options and the SAS macro variables that they represent:

Execution Options
Execution Option SAS Variable Name (Prompt Name)
Graphic device _GOPT_DEVICE
Output format _ODSDEST
ODS style _ODSSTYLE
Debug options _DEBUG

Previous Page | Next Page | Top of Page