BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
bheerschop
Obsidian | Level 7

I have a question regarding the table scope in SAS Viya. In the documentation  it can be seen that the In-Memory duration for a global table is long and available for all sessions and that the In-Memory duration for a Session table is medium and only for the current session.

 

It can be read that: "By default, when you load a table into memory, the table has session scope."

 

When I, for example, import a .xlsx file to a table in a CAS In Memory library, the table remains in memory even when my session ends or when I logout from SAS Viya. I would have expected that the table was dropped from memory when my session ended.

 

1) Can anyone explain why the table remains in memory after my session ends?

2) Is it possible to manipulate more specifically how long a table stays in memory? For example, if the data is not used for 3 weeks it should be dropped from memory.

 

I'm relatively new to SAS Viya so I still have a lot to learn.

 

Thanks,

Berry H.

 

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
1) It sounds like you are loading this table into a global caslib.
2) Documentation on the sample job you can configure to unload data based on how recently it was accessed can be found here. There are also jobs for importing and loading data automatically.

SAS Viya 3.5 Administration - CAS Table State Management
https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

3 REPLIES 3
gwootton
SAS Super FREQ
1) It sounds like you are loading this table into a global caslib.
2) Documentation on the sample job you can configure to unload data based on how recently it was accessed can be found here. There are also jobs for importing and loading data automatically.

SAS Viya 3.5 Administration - CAS Table State Management
https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm
--
Greg Wootton | Principal Systems Technical Support Engineer
acordes
Rhodochrosite | Level 12
If you import data through "mange data" the common behaviour from SAS is the following:
A file with the sashdat extension is written to disk.
And a sibling of a table gets loaded into memory. By default it gets promoted meaning that it is global scope surviving the current session.

What's the benefit of this approach?
You need a table in memory for reports in Visual Analytics.
If the table is dropped for whatsoever reason like restarting the server, the report can still fall back to the sashdat file and load it into memory again.
My explanation is not the most technical alive, but I learned my lessons the hard way.

If you import data through code in SAS Studio, then you can use proc casutil commands like promote casdata casout incaslib outcaslib or data step commands for caslibs using the promote=yes option in parenthesis after the data step's first line.
bheinsius
Lapis Lazuli | Level 10

Hi Berry,

 

To do this:

 

2) Is it possible to manipulate more specifically how long a table stays in memory? For example, if the data is not used for 3 weeks it should be dropped from memory.

you can use the lifetime subparameter in the CasOut parameter, as in :

briankinnebrew_0-1637339739385.png

I got this from @briankinnebrew 's post "Tired of deleting temporary CAS tables? Let CAS do it for you", found here.

 

Regards,

Bart

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 3 replies
  • 2047 views
  • 3 likes
  • 4 in conversation