BookmarkSubscribeRSS Feed
NY
Calcite | Level 5 NY
Calcite | Level 5

Hi Experts,

I have created a stored process with input and output parameters that I'm trying to call using SAS BI Web Services. My endpoint is JSON.

 

*ProcessBody; 
 
%global BANK 
        CALCULATIONTYPE 
        COMPANYID 
        CUSTOMERID 
        MODELCODE 
        PREVIOUSCALCULATIONDATE 
        PREVIOUSEXPECTEDLOSS 
        PREVIOUSLOSSGIVENDEFAULT 
        PREVIOUSPROBABILITYOFDEFAULT 
        QUESTIONNAIREGRADE; 
 
%STPBEGIN; 
 
*  End EG generated code (do not edit this line); 
 
 
proc printto log=" D:\RiskModels\RestLogs\web_service_test_%sysfunc(today(),yymmdd10.)-%sysfunc(compress(%sysfunc(time( ),time.),":")).log";
   run;
libname srcdata "D:\RiskModels\SourceData";
proc sql noprint;
select distinct Client_LGD format=16.8 into :lgd from srcdata.lgd_table where 
ID =&customerID;
quit;
%let probabilityOfDefault=0.5;
%let lossGivenDefault = &lgd;
%let expectedLoss = %sysevalf(&lgd. * &probabilityOfDefault.);


*  Begin EG generated code (do not edit this line); 
;*';*";*/;quit; 
%STPEND; 
 
*  End EG generated code (do not edit this line); 

My output parameters were defined as DOUBLE, but in the response in my API tester tool (POSTMAN for example),

 

they all show as STRING.

 

{
    "outputParameters": {
        "expectedLoss": "0.22068032",
        "probabilityOfDefault": "0.5",
        "lossGivenDefault": "0.44136064"
    }
}

 

When I looked in SAS documentation the example shows a response with string variables only.

Does anyone succeed transfer numeric parameters?

 

https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n1wblekhip1yrln1fv2s5b6a2d9f.htm 

image.png

 

Thank you very much,

Nufar.

0 Likes
JUST RELEASED

SAS Viya with pay-as-you-go pricing.

Deploy software automatically at the click of a button on the Microsoft Azure Marketplace.

Learn more

55 percent discount.jpg

Recommended by SAS
These recommendations are generated using AI from SAS. For personalized recommendations, sign in with your SAS profile.
Discussion stats
  • 0 replies
  • 161 views
  • 0 likes
  • 1 in conversation