<?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 SAS BI Web services - RESTful JSON response - strign parameters only in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/841534#M332750</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;*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 =&amp;amp;customerID;
quit;
%let probabilityOfDefault=0.5;
%let lossGivenDefault = &amp;amp;lgd;
%let expectedLoss = %sysevalf(&amp;amp;lgd. * &amp;amp;probabilityOfDefault.);


*  Begin EG generated code (do not edit this line); 
;*';*";*/;quit; 
%STPEND; 
 
*  End EG generated code (do not edit this line); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My output parameters were defined as DOUBLE, but in the response in my API tester tool (POSTMAN for example),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;they all show as STRING.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "outputParameters": {
        "expectedLoss": "0.22068032",
        "probabilityOfDefault": "0.5",
        "lossGivenDefault": "0.44136064"
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I looked in SAS documentation the example shows a response with string variables only.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone succeed transfer numeric parameters?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n1wblekhip1yrln1fv2s5b6a2d9f.htm" target="_self"&gt;https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n1wblekhip1yrln1fv2s5b6a2d9f.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 985px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76782i6FCE4D9876E23695/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nufar.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Oct 2022 13:52:19 GMT</pubDate>
    <dc:creator>NY</dc:creator>
    <dc:date>2022-10-30T13:52:19Z</dc:date>
    <item>
      <title>SAS BI Web services - RESTful JSON response - strign parameters only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/841534#M332750</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;*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 =&amp;amp;customerID;
quit;
%let probabilityOfDefault=0.5;
%let lossGivenDefault = &amp;amp;lgd;
%let expectedLoss = %sysevalf(&amp;amp;lgd. * &amp;amp;probabilityOfDefault.);


*  Begin EG generated code (do not edit this line); 
;*';*";*/;quit; 
%STPEND; 
 
*  End EG generated code (do not edit this line); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My output parameters were defined as DOUBLE, but in the response in my API tester tool (POSTMAN for example),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;they all show as STRING.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "outputParameters": {
        "expectedLoss": "0.22068032",
        "probabilityOfDefault": "0.5",
        "lossGivenDefault": "0.44136064"
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I looked in SAS documentation the example shows a response with string variables only.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone succeed transfer numeric parameters?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n1wblekhip1yrln1fv2s5b6a2d9f.htm" target="_self"&gt;https://documentation.sas.com/doc/en/itechcdc/9.4/wbsvcdg/n1wblekhip1yrln1fv2s5b6a2d9f.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 985px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76782i6FCE4D9876E23695/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nufar.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2022 13:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/841534#M332750</guid>
      <dc:creator>NY</dc:creator>
      <dc:date>2022-10-30T13:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS BI Web services - RESTful JSON response - strign parameters only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/841977#M332910</link>
      <description>I would use the proc json procedure to generate my json. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0nejfk9q0pzmnn181l92qk3ah2e.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0nejfk9q0pzmnn181l92qk3ah2e.htm&lt;/A&gt;</description>
      <pubDate>Tue, 01 Nov 2022 19:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/841977#M332910</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2022-11-01T19:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS BI Web services - RESTful JSON response - strign parameters only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/842026#M332936</link>
      <description>&lt;P&gt;Thank you for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117666"&gt;@rudfaden&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;You are right, proc json would work. But I'm trying to understand if I can use the simple way (defining output parameters in the STP) to send parameters that are not string in my reply. Any luck with that?&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Nufar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 06:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/842026#M332936</guid>
      <dc:creator>NY</dc:creator>
      <dc:date>2022-11-02T06:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS BI Web services - RESTful JSON response - strign parameters only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/842831#M333272</link>
      <description>NO. I do not think that is possible. SAS only have string and number as datatypes.</description>
      <pubDate>Mon, 07 Nov 2022 08:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-BI-Web-services-RESTful-JSON-response-strign-parameters-only/m-p/842831#M333272</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2022-11-07T08:52:54Z</dc:date>
    </item>
  </channel>
</rss>

