<?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 Reading JSON in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361792#M85376</link>
    <description>&lt;P&gt;Is there simple base SAS programming that read in the following JSON type data. See below example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Tenure: 2 spend: 5 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{ &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;tenure:6 products:4 region:PQ spend:7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Credit score:100 region:ont tenure:7 country:can&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Credit score:50 country:US&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Tenure:5 region:US spend:100 creditscore:300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2017 22:10:41 GMT</pubDate>
    <dc:creator>rboire</dc:creator>
    <dc:date>2017-05-25T22:10:41Z</dc:date>
    <item>
      <title>Reading JSON</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361792#M85376</link>
      <description>&lt;P&gt;Is there simple base SAS programming that read in the following JSON type data. See below example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Tenure: 2 spend: 5 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{ &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;tenure:6 products:4 region:PQ spend:7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Credit score:100 region:ont tenure:7 country:can&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Credit score:50 country:US&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Tenure:5 region:US spend:100 creditscore:300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 22:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361792#M85376</guid>
      <dc:creator>rboire</dc:creator>
      <dc:date>2017-05-25T22:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading JSON</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361804#M85379</link>
      <description>&lt;P&gt;Which version of SAS are you running?&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 22:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361804#M85379</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-25T22:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading JSON</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361952#M85448</link>
      <description>&lt;P&gt;I notice some "&lt;SPAN&gt;Credit score" have blanks in it, but the last one is not . which one is real world ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Assuming there is no blank in it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NOTE: if you have SAS9.4 M4 , best choice is libname + JSON engine.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
 infile '/folders/myfolders/xxxx.json' lrecl=300000  dlm='}: ';
 input x : $200. @@;
run;
data want;;
 merge x x(firstobs=2 rename=(x=value));
 if x=:'{' then do;x=substr(x,2); id+1;end;
 if mod(_n_,2)=1;
run;
proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9083i175BF49402628003/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 13:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-JSON/m-p/361952#M85448</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-05-26T13:30:40Z</dc:date>
    </item>
  </channel>
</rss>

