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?
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:
Load the data into memory.
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:
If you want to verify that the table is indeed available, you can list the library's contents:
In Summary
If your data seems to "disappear" between SAS© Studio and Visual Analytics:
Remember that the default load is private to the current session.
Use the PROMOTE statement via PROC CASUTIL to change the table's scope to global.
Your data will then be accessible across the platform.