,
Hello,
I am a new user who is trying to getting familiar with sas viya and CAS Rest API. I found I came across an issue while I tried to submit save andd drop actions by REST api.
Below is my load table and fetch actions,
The fetch response I got from the server is like this:
1 | 1000 | iphone5s | 1 | 4300 |
It's really hard to say what happened without checking the log file. So, if you do not mind, add the following to your CAS server's log configuration file (/opt/sas/viya/config/etc/cas/default/logconfig.xml) to trace REST API invocations and results to the CAS server log:
<logger name="App.tk.http.server">
<level value="trace"/>
</logger>
Restart CAS server, repeat a problem and send to me the most recent CAS server log from:
/var/log/sas/viya/cas/default
Hello, I firgured out the reason. The reason is when I sent the request(load table) by Ajax in angularjs, although I set parameter as "table:{name:'cart',caslib:'MYCASLIB3'}", the name of the table becomes "{name:'cart'}"( something like this, I forget the detail, it might be "{name:'cart'} " possibly.) So when I used runCode action to write new records, it actually wrote records into table 'cart' instead of "{name:'cart'}". Then you can see yes I did save the table, but it was I load and saved exactly the same table, instead of the new table.
I solved the problem partialy by setting parameter as "table:'cart'", but I don't like this way quite much since I still wanna assign this table to a global caslib instead of a session caslib generated automatically. Do you have any ideas how to fix it?
Thanks!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.