<?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: PROC JSON list of strings in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895745#M82949</link>
    <description>Thank you so much. That's so helpful.</description>
    <pubDate>Mon, 25 Sep 2023 18:57:23 GMT</pubDate>
    <dc:creator>ahmedmady94</dc:creator>
    <dc:date>2023-09-25T18:57:23Z</dc:date>
    <item>
      <title>PROC JSON list of strings</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895638#M82947</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get a list of strings using proc json like below:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc json out=json_in pretty;&lt;BR /&gt;export work.tweets /&lt;BR /&gt;nokeys nosastags;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the result as list of lists&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;['a'],&lt;/P&gt;&lt;P&gt;['b'],&lt;/P&gt;&lt;P&gt;['c']&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the result to be list of strings like that:&lt;/P&gt;&lt;P&gt;[ 'a',&lt;/P&gt;&lt;P&gt;'b',&lt;/P&gt;&lt;P&gt;'c']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the file tweets contains only one column called tweets containing strings a, b, c&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is that possible using proc json?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 10:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895638#M82947</guid>
      <dc:creator>ahmedmady94</dc:creator>
      <dc:date>2023-09-25T10:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC JSON list of strings</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895710#M82948</link>
      <description>&lt;P&gt;Don't know about the PROC but it should be trivial in a DATA step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file json_in ;
  set tweets end=eof;
  if _n_=1 then put '[' @;
  else put '.' @;
  put tweets :$quote. ;
  if eof then put ']' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will generate a nice pretty file like:&lt;/P&gt;
&lt;PRE&gt;["a"
,"b"
,"c"
]&lt;/PRE&gt;
&lt;P&gt;Instead of one with the commas in the wrong place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your values might include double quote characters you will need to confirm that the method the $QUOTE form uses to protect those characters is appropriate for a JSON file.&amp;nbsp; When the character used to quote a string appears in a string the normal way in SAS to indicate that is to double the embedded character.&amp;nbsp; So a string like He said, "Hello". will appear as&lt;/P&gt;
&lt;PRE&gt;"He said, ""Hello""."&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2023 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895710#M82948</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-25T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC JSON list of strings</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895745#M82949</link>
      <description>Thank you so much. That's so helpful.</description>
      <pubDate>Mon, 25 Sep 2023 18:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-JSON-list-of-strings/m-p/895745#M82949</guid>
      <dc:creator>ahmedmady94</dc:creator>
      <dc:date>2023-09-25T18:57:23Z</dc:date>
    </item>
  </channel>
</rss>

