Your SAS programs, embedded in web apps and elsewhere

SAS BI Web Services completed with nonzero SYSCC

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

SAS BI Web Services completed with nonzero SYSCC

[ Edited ]

Hello,

 

I'm starting to figure out how to leverage stored processes exposed as web services. I'm starting to test Stored Processes with a PROC HTTP.

 

The code for the SP is this

%global wsRC wsValue wsMsg returnString;

%let wsMsg = someDate=&someDate;

%macro runCode;
  proc sql noprint;
select &statName( &columnName ) into :wsValue trimmed from &tableName ; quit; %if &sqlrc = 0 %then %do; %let wsrc=&sqlrc; %end; %else %do; %let wsrc=&sqlrc; %let wsMsg = ERROR: &syserrortext; %let wsValue = .; %let syscc = 0; %end; %mend; %runCode

The PROC HTTP that uses this Stored Process is this

%let hostName = 192.168.1.61;
%let port = 7980;
%let SASBIWS_path = /SASBIWS/rest/storedProcesses;
%let stpName = /SAS Validation/SAS Stored Procedures/stp_02_ws;

*
* build parm list for REST XML request
*;
filename htin temp;
data _null_;
  infile cards;
  input;
  file htin;
  put _infile_;
cards4;
<any>
<parameters>
<tableName>sashelp.cars</tableName>
<columnName>invoice</columnName>
<statName>MEAN</statName>
<someDate>2016-01-17</someDate>
</parameters>
</any>
;;;;


*
* call STP as REST WS
*;
filename htout "/home/lasradm/Test/rest_test";
proc http
  method="POST"
  URL="http://&hostName:&port.&SASBIWS_path.&stpName"
  in=htin
  out=htout
  ct="application/xml"
  WEBUSERNAME="lasradm"
  WEBPASSWORD="sas"
 	
  verbose
  ;
run;

*
* display result
*;
data _null_;
  infile htout;
  input;
  putlog _infile_;
run;

filename htin clear;
filename htout clear;

This works fine, on the log I can see the result embedded in XML code.

Now I tryed to write a similar program passing different parameters to the SP. Didn't work. I restrict the problem on the library. As long as I use SASHELP it works. If I use a library defined by me (with all the permissions) it gives this generic error

 

HTTP Status 500 - Request processing failed; nested exception is com.
sas.web.services.WSException: SAS completed with nonzero SYSCC '1,012'.  SYSMSG: ''

Can't figure out where the problem lies.

I'm using SAS 9.4

 

edit: I found this code on this topic https://communities.sas.com/t5/Administration-and-Deployment/REST-in-webservices-in-sas-9-4-m3/td-p/...


Accepted Solutions
Solution
‎05-23-2017 05:25 AM
SAS Super FREQ
Posts: 709

Re: SAS BI Web Services completed with nonzero SYSCC

Hi

 

The error handling within the STP should return the proper error message. However it looks like you can not reset the SYSCC macro var.

 

Have a look here http://support.sas.com/kb/56/197.html and check whether the necessary hotfix is applied.

 

Bruno

View solution in original post


All Replies
Super User
Posts: 7,863

Re: SAS BI Web Services completed with nonzero SYSCC

SASHELP is the same for all users under all circumstances. Another library may be defined in metadata, but if the user running the STP server has no access to the directory or if there is a metadata permission problem, that library will not work.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 33

Re: SAS BI Web Services completed with nonzero SYSCC

I figured that, I gave all permissions to the folder that library is pointing to, I gave all permissions to the library itself in the management console. Still the same error, another suggestion on how can I solve this?
Super User
Posts: 7,863

Re: SAS BI Web Services completed with nonzero SYSCC

[ Edited ]

For which user did you set permissions on the physical directory? The OS user running the STP server (usually sassrv) needs the permissions, not the user with which you call the STP. That one needs mostly metadata permissions.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎05-23-2017 05:25 AM
SAS Super FREQ
Posts: 709

Re: SAS BI Web Services completed with nonzero SYSCC

Hi

 

The error handling within the STP should return the proper error message. However it looks like you can not reset the SYSCC macro var.

 

Have a look here http://support.sas.com/kb/56/197.html and check whether the necessary hotfix is applied.

 

Bruno

Contributor
Posts: 33

Re: SAS BI Web Services completed with nonzero SYSCC

Posted in reply to Bruno_SAS

Thanks, installing the hotfix resolved the problem.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 378 views
  • 1 like
  • 3 in conversation