Previous Page | Next Page

Writing a Stored Process

Setting Result Capabilities

A stored process is a SAS program that can produce any type of output that a valid SAS program can produce. Output could include data sets, external files, e-mail messages, SAS catalogs, packages, and many other objects. In some cases, the output (or a result) is delivered to the client application that is executing the stored process. In other cases, the output is generated only on the server.

When you register the stored process, you can specify what type of output the stored process can produce. You can specify Stream, Package, both output types, or neither output type.

When you run the stored process, the client application chooses the type of output that it prefers. For example, when SAS Web Report Studio runs a stored process, package output is produced. There are four types of client output:

Note:   Although the result type is chosen when you define a stored process, the result type can be changed by the client application through calls to the Stored Process Service API. Where possible, it is recommended that you write stored processes to support any appropriate client result type. This enables a client application to select the result type most appropriate for that application. The program can determine the desired client result type by examining the _RESULT input parameter. The %STPBEGIN and %STPEND macros include support for any of the four result types. For more information, see Using the %STPBEGIN and %STPEND Macros. The following stored process is capable of generating streaming, transient package, or permanent package output. (It can also be run with _RESULT set to STATUS , but this would produce no useful result.)

 *ProcessBody;
 %stpbegin;
 proc print data=SASHELP.CLASS noobs;
 var name age height;
 run;
 %stpend;

  [cautionend]

The input parameters that were mentioned previously are set by the stored process client APIs and are reserved parameters. They cannot be overridden by passing in new values through the normal parameter interface. Special API methods are provided to set the result type and associated parameters for a stored process. For more information about specific input parameters, see Using Reserved Macro Variables. For more information about developing stored processes that product package results, see Developing Stored Processes with Package Results.

Previous Page | Next Page | Top of Page