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

Hi,

I would like to load all cas tables automatically after the Viya restart. Here we can find an example of code we can add to casstartup_usermods.lua

s:table_addCaslib{caslib="worldbank",
     dataSource={srcType="path"},
     path="/rdstore/data/smp/world_bank",
     session=false}

There are 2 questions, any help is appreciated: 

1. I have a simple code in SAS4GL that checks the list of caslibs, then load all SASHDAT tables into memory. Maybe you've already done it before and can share the lua code that checks all the caslibs, then load tables from SASHDAT to cas? It would be much more efficient to load data automatically after restart instead of running SAS4gl code.

 

2. How can I test the LUA code presented behind? Even for a single table, how I can use s:table_addCaslib in SAS Studio  "proc lua" or command line "lua "? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
There are built-in sample jobs for loading and unloading CAS tables that might be helpful here:

CAS Table State Management
https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm

This is the PROC LUA doc on connecting to a CAS session:

LUA Procedure - Example 13: Connecting to the CAS Server
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1t2uas89u3nddn1tajxbv74xj0d.htm

Once you have the connection you could test that table_addCaslib code or any code using CAS actions. More information on using Lua to interact with CAS can be found here:

Getting Started with SAS® Viya® 3.5 for Lua
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/caspg3lua/titlepage.htm
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

1 REPLY 1
gwootton
SAS Super FREQ
There are built-in sample jobs for loading and unloading CAS tables that might be helpful here:

CAS Table State Management
https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm

This is the PROC LUA doc on connecting to a CAS session:

LUA Procedure - Example 13: Connecting to the CAS Server
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1t2uas89u3nddn1tajxbv74xj0d.htm

Once you have the connection you could test that table_addCaslib code or any code using CAS actions. More information on using Lua to interact with CAS can be found here:

Getting Started with SAS® Viya® 3.5 for Lua
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/caspg3lua/titlepage.htm
--
Greg Wootton | Principal Systems Technical Support Engineer

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1257 views
  • 3 likes
  • 2 in conversation