SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 38628: Using PROC OLAPOPERATE to close all sessions for a particular cube

DetailsCodeAboutRate It

Overview

The OLAPOPERATE procedure was introduced in SAS 9.2 as a way to interact with the SAS® OLAP Server in a batch or code-based environment. The procedure enables users to list active sessions or queries and to determine which sessions have data that is actively being displayed. The procedure also enables an administrative user to terminate a session based on an session's ID value.

Terminating all sessions

Often, you need to terminate all sessions that are querying a particular OLAP cube in your environment. To do this, you would need to determine the IDs of the sessions using the LIST SESSION CUBE=<cube name>; statement. This statement writes the IDs to the SAS log. You would then need to use CLOSE SESSION ID=<id value>; to terminate each session.

About the macro

The macro code included on the Full Code tab in this sample demonstrates how to accomplish this task in a batch environment by using the PRINTTO procedure and some DATA step code.

An example of calling this macro is:

     %CLOSE_SESSIONS(logfile=c:\mysaslog.log, host=localhost, port=5451,
                     userid=sasadm@saspw, password=sasadm1, cube=OrionStar);

The macro takes six parameters, which are explained in the following table.

Parameter nameDescriptionDefault value
logfile The location in which to write the SAS log referenced in the PRINTTO procedure. out.log
hostThe machine name or IP address on which your SAS OLAP Server is running.localhost
portThe port number on which your SAS OLAP Server is running.5451
useridAn account that has the Administer permission on the application server, and ReadMetadata permission on the repository.sasadm@saspw
passwordThe password for the administrative account.sasadm1
cubeThe cube name for which to stop the SAS OLAP Server sessions. Use _ALL_ to close any active sessions on the server._ALL_

Additional Documentation

For more information, see The OLAPOPERATE Procedure in the SAS 9.2 OLAP Server: User's Guide.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.