SAS VIYA Guide

Why is my CASUSER data not visible in Visual Analytics?

Simon 30/09/2023 5 views

When starting with SAS© Viya, it is common to navigate between multiple interfaces like SAS© Studio and SAS© Visual Analytics (VA). A common confusion arises when handling data in the personal library, CASUSER.

The scenario is classic: you load a table into your CASUSER library via SAS© Studio. Everything seems to work. However, when you switch to Visual Analytics to create a report from this same table, it is nowhere to be found. Conversely, a table loaded via the Environment Manager interface remains invisible in SAS© Studio.

Why this partitioning when you are using the same ID on the same server?

Illustration

Understanding "Session Scope"

The heart of the problem lies in memory management by the CAS server.

When you connect to SAS© Studio, you initiate a specific CAS session. By default, the tables you load into memory have a session scope (session scope). This means they are only visible and usable by the session that created them.

Visual Analytics and SAS© Environment Manager often open their own separate sessions. Consequently, the Visual Analytics session cannot see the private data stored in the SAS© Studio session's memory, even if it's technically in your CASUSER personal library.

The Solution: Promote the table

To make a table visible across different applications (and therefore different sessions), you must change its scope. This is called promoting the table (Promote).

The promotion action moves the table from local visibility (session) to global visibility (Global Scope). Once global, the table becomes accessible to all your sessions, whether you are in Studio, VA, or Environment Manager.

How to do it in practice?

The preferred tool for this operation is the CASUTIL procedure. Here is the logic to follow:

  1. Load the data into memory.

  2. Use the PROMOTE statement to make it global.

SAS© Code Example

Suppose you have created a table named irisout in your session. To make it visible in Visual Analytics, use the following code:

1/* Exemple de promotion d'une table */
2PROC CASUTIL outcaslib="casuser";
3 promote casdata="irisout";
4QUIT;

If you want to verify that the table is indeed available, you can list the library's contents:

1 
2PROC CASUTIL incaslib="casuser";
3 
4contents casdata="irisout";
5 
6QUIT;
7 

In Summary

If your data seems to "disappear" between SAS© Studio and Visual Analytics:

  1. Remember that the default load is private to the current session.

  2. Use the PROMOTE statement via PROC CASUTIL to change the table's scope to global.

  3. Your data will then be accessible across the platform.