<?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 add results of macro variable addition to json returned by stored process in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/add-results-of-macro-variable-addition-to-json-returned-by/m-p/447965#M112617</link>
    <description>&lt;P&gt;I use this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Result = %sysevalf(&amp;amp;Number1. + &amp;amp;Number2.); 

%let old = %sysfunc(stpsrv_header(Content-type, application/json));
%let old = %sysfunc(stpsrv_header(Access-Control-Allow-Origin, *));

data _null_;
     file _webout;
     put '{ "name":"John1", "age":31, "city":"New York" }'; 
     run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here the Number1 and Number2 macro variables come from prompts and should ultimately come from query strings. How can I add the Result macro variable to the JSON file to achieve something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{ "name":"John1", "age":31, "city":"New York", "Result":"333" }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ff&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 21:26:29 GMT</pubDate>
    <dc:creator>csetzkorn</dc:creator>
    <dc:date>2018-03-22T21:26:29Z</dc:date>
    <item>
      <title>add results of macro variable addition to json returned by stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-results-of-macro-variable-addition-to-json-returned-by/m-p/447965#M112617</link>
      <description>&lt;P&gt;I use this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Result = %sysevalf(&amp;amp;Number1. + &amp;amp;Number2.); 

%let old = %sysfunc(stpsrv_header(Content-type, application/json));
%let old = %sysfunc(stpsrv_header(Access-Control-Allow-Origin, *));

data _null_;
     file _webout;
     put '{ "name":"John1", "age":31, "city":"New York" }'; 
     run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here the Number1 and Number2 macro variables come from prompts and should ultimately come from query strings. How can I add the Result macro variable to the JSON file to achieve something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{ "name":"John1", "age":31, "city":"New York", "Result":"333" }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ff&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 21:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-results-of-macro-variable-addition-to-json-returned-by/m-p/447965#M112617</guid>
      <dc:creator>csetzkorn</dc:creator>
      <dc:date>2018-03-22T21:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: add results of macro variable addition to json returned by stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-results-of-macro-variable-addition-to-json-returned-by/m-p/447972#M112619</link>
      <description>&lt;P&gt;Would it be acceptable to use single quotes instead of double quotes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{ 'name':'John1', 'age':31, 'city':'New York', 'Result':'333' }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, the PUT statement could use double quotes on the outside, and the end might look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put "{ ..................... 'Result':'&amp;amp;result' }"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 21:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-results-of-macro-variable-addition-to-json-returned-by/m-p/447972#M112619</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-22T21:47:21Z</dc:date>
    </item>
  </channel>
</rss>

