<?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 Re: Parsing double stringify JSON data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/638795#M189975</link>
    <description>That helps. Thank you</description>
    <pubDate>Thu, 09 Apr 2020 20:40:14 GMT</pubDate>
    <dc:creator>ellen09</dc:creator>
    <dc:date>2020-04-09T20:40:14Z</dc:date>
    <item>
      <title>Parsing double stringify JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631663#M187169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I retrieve a JSON file which looks like below, and I am trying to parse it. The value of name "C" is quoted as a string, however, it is also an array. I am trying to parse it with both libname json engine and DS2 procedure, but I don't know how to parse inside the value of "C".&amp;nbsp; Any help appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"result": {&lt;BR /&gt;"status": "good"&lt;BR /&gt;},&lt;BR /&gt;"reviews": [&lt;BR /&gt;{&lt;BR /&gt;"A": 32,&lt;BR /&gt;"B": "name1",&lt;BR /&gt;"C": "{\"x1\": {\n \"A1\": {\"y1\": [\n {\n \"fname\": \"p1\",\n \"mname\": \"p2\",\n }\n ]\n}}",&lt;BR /&gt;"D": "New"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"A": 38,&lt;BR /&gt;"B": "name2",&lt;BR /&gt;"C": "{\"x1\": {\n \"B1\": {\"y1\": [\n {\n \"fname\": \"q1\",\n \"mname\": \"q2\",\n }\n ]\n}}",&lt;BR /&gt;"D": "New"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 17:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631663#M187169</guid>
      <dc:creator>ellen09</dc:creator>
      <dc:date>2020-03-12T17:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing double stringify JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631708#M187186</link>
      <description>&lt;P&gt;What's the desired output?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 20:56:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631708#M187186</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-12T20:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing double stringify JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631836#M187234</link>
      <description>&lt;P&gt;I am hoping to get a data set like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 331px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36837iDC2C6C47FC5A8A88/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 12:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/631836#M187234</guid>
      <dc:creator>ellen09</dc:creator>
      <dc:date>2020-03-13T12:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing double stringify JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/632134#M187378</link>
      <description>&lt;P&gt;The simplest if the JSON's structure is quite constant:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FNAME=scan(C, 9,':\"{}');&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;MNAME=scan(C,12,':\"{}');&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the string varies more, you may have to look for the positions of &lt;FONT face="courier new,courier"&gt;fname&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;mname&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it varies a lot, you may have to resort to regular expressions to isolate the bits you want, or use several statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A data step allows you to read the JSON string using an input statement, but DS2 cannot afaik:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Management/Parsing-a-string-variable/td-p/157459" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Management/Parsing-a-string-variable/td-p/157459&lt;/A&gt;&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>Sat, 14 Mar 2020 10:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/632134#M187378</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-14T10:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing double stringify JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/638795#M189975</link>
      <description>That helps. Thank you</description>
      <pubDate>Thu, 09 Apr 2020 20:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-double-stringify-JSON-data/m-p/638795#M189975</guid>
      <dc:creator>ellen09</dc:creator>
      <dc:date>2020-04-09T20:40:14Z</dc:date>
    </item>
  </channel>
</rss>

