An Overview of SAS Stored Processes
Recommended by 0 users
What Is a SAS Stored Process?
A stored process
- is a SAS program that is hosted on a server and described by metadata
- can be executed by many of the new clients in the SAS®9 Intelligence Platform
- is similar in concept to programs run by SAS/IntrNet, but more versatile because of the underlying metadata and security support.
The ability to store your SAS programs on the server provides an effective method for change control management.
The stored process concept becomes even more powerful when you consider that these SAS programs can be invoked from multiple client contexts.
Using stored processes also enhances security and application integrity because the programs that access your sensitive data are contained on the server instead of being widely distributed with the client applications.
Instead of embedding the SAS code into client applications, you can centrally maintain and manage this code from the server. This gives you the ability to change your SAS programs and at the same time ensure that every client that invokes a stored process will always get the latest version available.
Stored Processes Uses
Stored processes can be used for
- Web reporting
- delivering result packages to clients or the mid-tier
- publishing results to channels or repositories.
Stored Process Input
Stored processes can access
- SAS data sources
- external files.
Stored Process Output
A stored process can produce any kind of output that a SAS program can produce:
- data sets
- external files
- ODS output
- result packages.
Stored Process Desktop Clients
Stored processes can be accessed/executed from several different client environments:
- SAS Add-In for Microsoft Office
- SAS Enterprise Guide
- SAS Information Map Studio.
Existing or new SAS code can be converted to a stored process and that stored process is registered in the SAS Management Console.
Beginning with version 3, SAS Enterprise Guide is the preferred method for working with stored processes because it provides the ability to create, register, and test stored processes from one interface.
Stored Process Web Clients
Stored processes can be accessed/executed from different Web-based environments:
- Stored Process Web Application
- SAS Web Report Studio
- SAS Information Delivery Portal.
Stored Processes Metadata Structure
Metadata is used in stored processes to describe
- input parameters
- input data sources
- output options
- execution environment
- descriptive data
- security options.
Stored Process Server Types
Stored processes can be hosted by two types of servers:
- SAS Stored Process Servers
- SAS Workspace Servers.
These two servers are similar but have different capabilities.
Stored Process Server
The Stored Process Server
- is a multiuser server
- is a single process shared by many clients
- runs under a single shared user identity
- is dedicated to executing stored processes
- implements several features not available on the workspace servers including:
– streaming output
– multiple-value input parameters
– support for stored process web services.
Because the stored process server runs under the SASSRV user ID, stored process code can access two macro variables to identify the user:
specifies the person metadata name that is associated with the _METAUSER login variable. The value of this variable can be UNKNOWN.
specifies the login username that is used to connect to the metadata server.
Example: These macro variables can be used in the stored process code in a FOOTNOTE statement to identify who executed the stored process:
Make sure to use double quotes around the string so that the macro variable values will be resolved.
The Workspace Server
- is a single user server
- provides a new process that is started for each client
- each server starts with the client identity, so there are some security advantages.
If you want to use a stored process to provide data to an information map, it must be executed on a workspace server, and that workspace server must be the same one that runs the information map.
SAS/IntrNet and Stored Processes
Stored processes are generally backward compatible with the SAS/IntrNet Application Dispatcher.
Most existing Application Dispatcher programs can be registered as a stored process with little or no conversion. This is possible because Application Dispatcher programs and stored processes share many capabilities, including
- _WEBOUT for streaming output
- same ODS options
- macro variables for input parameters
- similar debugging options.
Stored Process Samples
This demonstration shows the metadata information stored for a sample stored process.
- Start the SAS Management Console by selecting Start Ð All Programs Ð SAS Ð SAS Management Console, select the BIArchitecture metadata profile and enter the username and password provided by the instructor.
2. Expand Stored Process Manager in the Navigation Tree.
3. Expand the Samples group.
4. Select the Stored Processes group.
The sample stored processes are displayed in the Display Area.
The physical programs for the Stored Process Samples are stored in C:\Program Files\SAS\SAS 9.1\inttech\sample.
5. Right-click on the Hello World sample and select Properties from the pop-up menu.
6. The General tab provides the name, description, and keywords for the stored process.
Keywords are useful when you search for a specific stored process in applications such as the SAS ID Portal.
7. The Execution tab provides important information about which server, the stored process will be executed on, where the stored process source code is located, and input and output options.
The SAS server where the stored process will execute.
The directory where the physical SAS program is stored. This is not the metadata repository. It is an operating system location where the SAS program resides.
The name of the .sas file that contains your Stored Process.
The results of the stored process will be delivered. Choices include:
A stored process result type in which the content generated by the stored process is delivered to the client through an output stream. The output stream is generally visible to the stored process as the _WEBOUT fileref.
transient result package
A container for content that was produced by a SAS program execution or a third-party application for immediate use, and that is not saved. After you disconnect from the server, the transient result package disappears.
permanent result package
A container for content that was produced by a SAS program execution or a third-party application, and that is written to a specific location. Permanent result packages remain in existence, even after the stored process completes execution and you disconnect from the server.
In cases where there is no report (such as when you are only creating a data set).
8. The Parameters tab is where parameters are defined for the stored process. Parameters used in stored processes are similar to those used in SAS Application Dispatcher programs. You pass parameters to the SAS program, which then uses them as macro variables that can change the behavior and output of the program.
The Hello World sample has no parameters. It can run without any additional information from the user.
9. The Authorization tab is used to determine who can view, use, and update the stored process.
10. Select to close the Properties window.
11. Select File Ð Exit to exit the SAS Management Console.