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

Can anyone help me with the syntax to load table to a caslib on startup using the casstartup_usermods.lua file in viya 3.5?

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Have a look at this article, https://communities.sas.com/t5/SAS-Communities-Library/tips-amp-tricks-for-writing-Lua-code-for-the-... published today. It will show you code examples on loading all files with a given name pattern as CAS tables. Search for "How to call CAS actions and process the result within a Lua program". 

View solution in original post

4 REPLIES 4
carl_sommer
SAS Employee

From SAS Help Center: SAS Cloud Analytic Services: Concepts
under the Understanding Configuragion Files and Start-up Files / Standard Configuration Files heading:

 

casstartup_usermods.lua

This file contains modifications that are made by the SAS administrator to casstartup.lua, such as adding global-scope caslibs and loading global-scope tables. Using casstartup_usermods.lua ensures that your modifications are not overwritten when you upgrade CAS.

CAS processes casstartup_usermods.lua before any of the other start-up files residing in the start.d/ directory.

Use Lua syntax such as the following. Do not forget to use global scope.

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

 

Carl Sommer - SAS Technical Support

sangavis37
Obsidian | Level 7

Hi Carl,

Thank you for the suggestion. I tried this (with the same syntax). Now the caslib is not visible anymore. If I create a new caslib, I get the below error:

 

The specified directory for caslib openbaar already exists.

Caslib openbaar already exists.

The action stopped due to errors.

 

code: 2-0-2640516

property: PERM_CL_EXISTS

uri: /casManagement/servers/cas-shared-default/caslibs

path: /SASDataExplorer/ui/datasources/validation

traceId: 3b375ad84becf405



Should I have done session=true instead of false? Do you know how I can make this caslib visible again?

BrunoMueller
SAS Super FREQ

Have a look at this article, https://communities.sas.com/t5/SAS-Communities-Library/tips-amp-tricks-for-writing-Lua-code-for-the-... published today. It will show you code examples on loading all files with a given name pattern as CAS tables. Search for "How to call CAS actions and process the result within a Lua program". 

sangavis37
Obsidian | Level 7

Thank you! This helped me understand the concept much better.

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
  • 4 replies
  • 567 views
  • 0 likes
  • 3 in conversation