<?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 Error: table does not exist in caslib when executing runCode action in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/394049#M109</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hello,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am using angularjs to invoke runCode action while I came across the error"table does not exist".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is my code.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var loadT={caslib:'MYCASLIB3',path:'cart.sashdat',casout:{name:'cart',caslib:'MYCASLIB3'}};&lt;/P&gt;&lt;P&gt;var Code={code:"data cart;set cart;run;"};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$http({&lt;BR /&gt;method:'POST',&lt;BR /&gt;url:baseURL+'/actions/loadTable',&lt;BR /&gt;headers:_headers,&lt;BR /&gt;&lt;U&gt;params:loadT&lt;/U&gt;&lt;BR /&gt;}).then(function(){$http({&lt;BR /&gt;method:'POST',&lt;BR /&gt;url:baseURL+'/actions/runCode',&lt;BR /&gt;headers:_headers,&lt;BR /&gt;&lt;U&gt;params:Code&lt;/U&gt;&lt;BR /&gt;}).then(function callBack(response){console.log(response);});});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So you can see that before I invoked the runCode action i have already excecuted loadTable action, I know I loaded table sucessfully otherwisde I cannot get the runCode action executed. I don't know why I still receive an error that "&amp;nbsp;&lt;SPAN&gt;ERROR: The table cart in caslib MYCASLIB3 does not exist." , which means that it did look for cart in the caslib MYCASLIB3, but it does not find it.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Anybody knows why?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2017 20:41:17 GMT</pubDate>
    <dc:creator>xiaoys0725</dc:creator>
    <dc:date>2017-09-07T20:41:17Z</dc:date>
    <item>
      <title>Error: table does not exist in caslib when executing runCode action</title>
      <link>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/394049#M109</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am using angularjs to invoke runCode action while I came across the error"table does not exist".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is my code.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var loadT={caslib:'MYCASLIB3',path:'cart.sashdat',casout:{name:'cart',caslib:'MYCASLIB3'}};&lt;/P&gt;&lt;P&gt;var Code={code:"data cart;set cart;run;"};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$http({&lt;BR /&gt;method:'POST',&lt;BR /&gt;url:baseURL+'/actions/loadTable',&lt;BR /&gt;headers:_headers,&lt;BR /&gt;&lt;U&gt;params:loadT&lt;/U&gt;&lt;BR /&gt;}).then(function(){$http({&lt;BR /&gt;method:'POST',&lt;BR /&gt;url:baseURL+'/actions/runCode',&lt;BR /&gt;headers:_headers,&lt;BR /&gt;&lt;U&gt;params:Code&lt;/U&gt;&lt;BR /&gt;}).then(function callBack(response){console.log(response);});});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So you can see that before I invoked the runCode action i have already excecuted loadTable action, I know I loaded table sucessfully otherwisde I cannot get the runCode action executed. I don't know why I still receive an error that "&amp;nbsp;&lt;SPAN&gt;ERROR: The table cart in caslib MYCASLIB3 does not exist." , which means that it did look for cart in the caslib MYCASLIB3, but it does not find it.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Anybody knows why?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 20:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/394049#M109</guid>
      <dc:creator>xiaoys0725</dc:creator>
      <dc:date>2017-09-07T20:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error: table does not exist in caslib when executing runCode action</title>
      <link>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/549616#M309</link>
      <description>Can you send the log output from your loadTable action? &lt;BR /&gt;Also:&lt;BR /&gt;1. Is the path you specified accessible from cas?&lt;BR /&gt;2. To check the status of an action call you need to check the disposition object in the response. Cas will return if there are programming errors. This is the reason your .then executed.&lt;BR /&gt;It would be easier to  discuss your use case if we can see the log output.&lt;BR /&gt;Cheers...&lt;BR /&gt;Deva</description>
      <pubDate>Tue, 09 Apr 2019 14:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/549616#M309</guid>
      <dc:creator>kumardeva</dc:creator>
      <dc:date>2019-04-09T14:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error: table does not exist in caslib when executing runCode action</title>
      <link>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/550489#M319</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Just to complete the thought: &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you call cas action via REST (or by scripting) always check the disposition object in the response.&lt;/P&gt;
&lt;P&gt;While cas will&amp;nbsp; return a http code of 200 when you have programming errors it does return useful information in the disposition object and in the log object. You should always check the disposition object before going to the next step - bullet proof your app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A typical code might look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (dispostion.statusCode !== &amp;nbsp;0&amp;nbsp; || disposition.severity === ‘Error’) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; throw &amp;nbsp;‘Huston we have a problem’;&lt;/P&gt;
&lt;P&gt;} else {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; …do whatever you want…&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;And a second thought:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you plan to make a series of REST calls for cas actions, consider switching to scripting on the server using the casl&amp;nbsp; language via the sccasl.runcasl action. This will save you multiple round trips to the server. You can use the casl language features to script your actions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers...&lt;BR /&gt;Deva&lt;/P&gt;
&lt;P&gt;PS:&amp;nbsp; If you are using REST API to access Viya please take a look at &lt;A href="https://github.com/sassoftware/restaf%20" target="_blank" rel="noopener"&gt;https://github.com/sassoftware/restaf&lt;/A&gt; for a very useful js library.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 02:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Error-table-does-not-exist-in-caslib-when-executing-runCode/m-p/550489#M319</guid>
      <dc:creator>kumardeva</dc:creator>
      <dc:date>2019-04-12T02:46:53Z</dc:date>
    </item>
  </channel>
</rss>

