Previous Page | Next Page

Writing SAS BI Web Services Using XMLA

Writing SAS Programs for XMLA Web Services

To use the Web service to call your SAS code, you must configure your SAS code as a stored process. A stored process is a SAS program that is stored on a server and can be executed by requesting applications. Any stored process can be deployed as a generated Web service. However, stored processes that are used with XMLA Web services need to conform to rules that enable the Web service to receive data from the client and return data to the client.

You can author a stored process manually by using SAS or a text editor to write the code and then registering the program through SAS Management Console. Alternatively, you can use a program such as SAS Enterprise Guide or another SAS code generator to author a stored process using the point-and-click method. Use the following modifications to make a stored process that can be used with SAS BI Web Services. Keep in mind that XMLA Web services can return data only; no images can be returned.

Note:   XMLA Web services in SAS 9.2 will work only with SAS 9.2 stored process metadata and SAS 9.2 Stored Process Servers.  [cautionend]

The following list explains unique details about stored processes that are used with XMLA Web services:

The following example code displays a stored process that is used as a Web service:

libname instream xml;
libname _WEBOUT xml xmlmeta=&_XMLSCHEMA;

proc means data=instream.&tablename
   output out=_WEBOUT.mean;
run;

The first LIBNAME statement in the sample code defines the data source. This code corresponds to the definition of the data source in the Stored Process Properties dialog box in SAS Management Console. The fileref of the data source is instream . In this example, the data source provides the data to run PROC MEANS against.

The second LIBNAME statement in the sample code defines the output for the stored process as streaming output, or _WEBOUT. In the Stored Process Properties dialog box, Stream is specified as the type of output on the Execution tab of the Stored Process Properties dialog box.

The &tablename declaration in the sample code defines a parameter called tablename. In the Stored Process Properties dialog box, this parameter is specified through the New Prompt dialog box, and can be modified using the Edit Prompt dialog box. In this example, tablename is a text parameter that specifies the name of the table to run PROC MEANS against.

Note:    The dialog boxes mentioned in the previous example are available from both the Stored Process Properties dialog box and the New Stored Process Wizard, which are both part of SAS Management Console. For more information about using SAS Management Console to define metadata for stored processes, see the product Help.  [cautionend]

Previous Page | Next Page | Top of Page