BookmarkSubscribeRSS Feed
Fluorite | Level 6



I am using angularjs to invoke runCode action while I came across the error"table does not exist".


Below is my code. 



var loadT={caslib:'MYCASLIB3',path:'cart.sashdat',casout:{name:'cart',caslib:'MYCASLIB3'}};

var Code={code:"data cart;set cart;run;"};



}).then(function callBack(response){console.log(response);});});


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 " 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. 


Anybody knows why?


SAS Employee
Can you send the log output from your loadTable action?
1. Is the path you specified accessible from cas?
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.
It would be easier to discuss your use case if we can see the log output.

Register today and join us virtually on June 16! | #SASGF

View now:

SAS Employee

Just to complete the thought:


if you call cas action via REST (or by scripting) always check the disposition object in the response.

While cas will  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.


A typical code might look like this:


if (dispostion.statusCode !==  0  || disposition.severity === ‘Error’) {

   throw  ‘Huston we have a problem’;

} else {

  …do whatever you want…



And a second thought:


If you plan to make a series of REST calls for cas actions, consider switching to scripting on the server using the casl  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.



PS:  If you are using REST API to access Viya please take a look at for a very useful js library.

Register today and join us virtually on June 16! | #SASGF

View now:


Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation