Contents Implementation & Administration Guide 1.1 Previous Next

Stored Process Metadata Example

This page provides examples of metadata for stored processes. The examples are based on the stored process prdsale1.sas, which is installed automatically in the demo portal. You can find the source file for this stored process in the "SASDemos" directory within the portal's installation directory. When you log on to the portal with the user name "portaldemo," the stored process appears in the Reports window as "Product Sales Demo."

Defining the Stored Process Path

First, you must update the enterprise directory with metadata identifying the path where your stored processes reside. When you install the demo version of the portal, a stored process path called Portal Demo Stored Processes is automatically defined using the value you provide in the the $SAS_DEMO_DIR$: parameter of the Install.properties file.

To view this metadata, open the IT Administrator interface, select the Applications button, and select the Portal Demo Stored Processes entry under Stored Process Paths, as shown below.

IT Admin screen; Stored process detail

The stored process path is the complete path to the file on which the stored processes reside. The logical name identifies the server. (For information about the SAS servers defined in your enterprise directory, select the SAS Configuration button.)

If you want to define another stored process path, choose File, New from the menu bar and enter the path information in the following dialog box:

IT Admin: New Stored Process Path window

Defining the Stored Process

Next, you must update the enterprise directory with metadata to define the stored process and its execution parameters.

In IT Administrator, you can view the metadata for the stored process prdsale1.sas by selecting Product Sales Demo in the tree under the Portal Demo Stored Processes path, as shown below.

IT Admin; Stored Process detail

The metadata for the stored process includes:

Description
An optional Description, for documentation purposes

Descriptive Label
A label to identify the stored process on lists in the portal.

File
The SAS program file containing the stored process

Note: Before placing the file name in the enterprise directory, IT Administrator appends it to the value of the descriptive label attribute, described above, followed by an underscore character.

In this example, IT Administrator appends the program file name prdsale1.sas to the descriptive label Product Sales Demo. The resulting value, Product Sales Demo_prdsale1.sas is assigned to the sasstoredprocessvalue attribute on the entperprise directory. If you are entering your metadata directly into the enterprise directory, it is important to use this format for the sasstoredprocessvalue attribute.

Portal JSP
The path to the JSP file that contains the input form to be displayed in the portal for execution parameter selection. The JSP must be located within the ServletContext of the portal application. This example uses the portal application's default input form, which automatically renders your stored process parameters as list boxes in the portal.

Parameters
The parameters that are passed to the SAS program upon execution. The parameters for the stored process prdsale1.sas are as follows.
Note: Your DATA_SOURCE value will be different, since it will reflect the structure of your enterprise directory.
NAME=pCountry|LABEL=Country|DESCRIPTION=Country|
  REQUIRED=true|DEFAULT=|
  DATA_SOURCE=sasuniquename=prdsale,cn=sasTables, 
  sascomponent=sasDataSources,cn=SAS, 
  ou=Pubs,o=SAS Institute,c=US|
  REPORT_QUERY=select distinct country from sashelp.prdsale

NAME=pYear|LABEL=Year|DESCRIPTION=Year| REQUIRED=true|DEFAULT=| DATA_SOURCE=sasuniquename=prdsale,cn=sasTables, sascomponent=sasDataSources,cn=SAS, ou=Pubs,o=SAS Institute,c=US| REPORT_QUERY=select distinct year from sashelp.prdsale

The parameters pCountry and pYear have the same names as the variables that were defined in the prologue section of the SAS program prdsale1.sas.

The DATA_SOURCE is the the fully qualified distinguished name of the table that contains valid values for the parameter. In this case, the data source is a table. (You can see the metadata that have been defined for the table by selecting the SAS Data Sources button in the IT Administrator interface.)

The REPORT_QUERY contains an SQL statement to extract the valid values for pCountry (or pYear) from the table. When the stored process is invoked from the portal, these values will be placed in list boxes on the portal's default user input form.

Instead of defining a data source and report query for a parameter's valid values, you can hard-code the valid values into the parameter definition. This method may be appropriate when it is unlikely that the valid values will change. For example, here is the pCountry parameter definition with hard-coded valid values:

NAME=pCountry|LABEL=Country|DESCRIPTION=Country|
  REQUIRED=true|DEFAULT=|VALUES=CANADA,GERMANY,U.S.A.

If you want to define another stored process within a path, select the path and choose File, New from the menu bar. Then enter the stored process information in the following dialog box:

IT Admin; New Stored Process window


Contents Implementation & Administration Guide 1.1 Previous Next