<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Modify casstartup_usermods.lua to load cas table automatically from SASHDAT files after restart in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-casstartup-usermods-lua-to-load-cas-table-automatically/m-p/785734#M23527</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would like to load all cas tables automatically after the Viya restart. &lt;A href="https://go.documentation.sas.com/doc/en/calcdc/3.5/calserverscas/n05000viyaservers000000admin.htm?homeOnFail" target="_self"&gt;Here&lt;/A&gt; we can find an example of code we can add to&amp;nbsp;&lt;EM&gt;casstartup_usermods.lua&lt;/EM&gt;&lt;/P&gt;
&lt;PRE class="xisDoc-codeFragment"&gt;&lt;CODE&gt;s:table_addCaslib{caslib="worldbank",
     dataSource={srcType="path"},
     path="/rdstore/data/smp/world_bank",
     session=false}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are 2 questions, any help is appreciated:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. How can I test the LUA code presented behind? Even for a single table, how I can use&amp;nbsp;&lt;CODE&gt;s:table_addCaslib&lt;/CODE&gt;&amp;nbsp;in SAS Studio&amp;nbsp; "proc lua" or command line "lua "?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Dec 2021 12:04:01 GMT</pubDate>
    <dc:creator>idziemianczyk</dc:creator>
    <dc:date>2021-12-13T12:04:01Z</dc:date>
    <item>
      <title>Modify casstartup_usermods.lua to load cas table automatically from SASHDAT files after restart</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-casstartup-usermods-lua-to-load-cas-table-automatically/m-p/785734#M23527</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would like to load all cas tables automatically after the Viya restart. &lt;A href="https://go.documentation.sas.com/doc/en/calcdc/3.5/calserverscas/n05000viyaservers000000admin.htm?homeOnFail" target="_self"&gt;Here&lt;/A&gt; we can find an example of code we can add to&amp;nbsp;&lt;EM&gt;casstartup_usermods.lua&lt;/EM&gt;&lt;/P&gt;
&lt;PRE class="xisDoc-codeFragment"&gt;&lt;CODE&gt;s:table_addCaslib{caslib="worldbank",
     dataSource={srcType="path"},
     path="/rdstore/data/smp/world_bank",
     session=false}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are 2 questions, any help is appreciated:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. How can I test the LUA code presented behind? Even for a single table, how I can use&amp;nbsp;&lt;CODE&gt;s:table_addCaslib&lt;/CODE&gt;&amp;nbsp;in SAS Studio&amp;nbsp; "proc lua" or command line "lua "?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 12:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Modify-casstartup-usermods-lua-to-load-cas-table-automatically/m-p/785734#M23527</guid>
      <dc:creator>idziemianczyk</dc:creator>
      <dc:date>2021-12-13T12:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Modify casstartup_usermods.lua to load cas table automatically from SASHDAT files after restart</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-casstartup-usermods-lua-to-load-cas-table-automatically/m-p/785882#M23536</link>
      <description>There are built-in sample jobs for loading and unloading CAS tables that might be helpful here:&lt;BR /&gt;&lt;BR /&gt;CAS Table State Management&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/calcdc/3.5/caldatamgmtcas/n150v9svjp42ron1hn9r496xj49m.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This is the PROC LUA doc on connecting to a CAS session:&lt;BR /&gt;&lt;BR /&gt;LUA Procedure - Example 13: Connecting to the CAS Server&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1t2uas89u3nddn1tajxbv74xj0d.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1t2uas89u3nddn1tajxbv74xj0d.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;Getting Started with SAS® Viya® 3.5 for Lua&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/caspg3lua/titlepage.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/caspg3lua/titlepage.htm&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Dec 2021 20:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Modify-casstartup-usermods-lua-to-load-cas-table-automatically/m-p/785882#M23536</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-12-13T20:54:07Z</dc:date>
    </item>
  </channel>
</rss>

