<?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: Reading NDJSON (Newline Delimited JSON). in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665743#M199104</link>
    <description>Thank you Ahmed. It works!!!</description>
    <pubDate>Mon, 29 Jun 2020 10:51:55 GMT</pubDate>
    <dc:creator>ndhaubhadel</dc:creator>
    <dc:date>2020-06-29T10:51:55Z</dc:date>
    <item>
      <title>Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665720#M199100</link>
      <description>&lt;P&gt;I am trying to import a NDJSON file from SAS but I am unable to do so using proc json statement. Is there any other way to read in such file?&lt;/P&gt;&lt;P&gt;Link to NDJSON file I am trying to read in SAS is &lt;A href="https://bcda.cms.gov/assets/data/Patient.ndjson" target="_blank"&gt;https://bcda.cms.gov/assets/data/Patient.ndjson&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 08:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665720#M199100</guid>
      <dc:creator>ndhaubhadel</dc:creator>
      <dc:date>2020-06-29T08:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665730#M199101</link>
      <description>&lt;P&gt;I answered similar question last week.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try converting the NDJSON into a JSON, then using SAS to import it&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename jsonl url "https://bcda.cms.gov/assets/data/Patient.ndjson";
filename json temp;
filename map temp;

/* Convert the NDJSON to JSON */
data _null_;
	infile jsonl end=eof;
	file json;
	put '[{"records":['; /* Required for JSON formatting */
	do until (eof);
		input;
		line = STRIP(_infile_);
		if (eof=0) then
			line=cats(line, ',');

		put line;
	end;
	put ']}]'; /* Required for JSON formatting */
	stop;
run;
libname json json automap=create map=map;
/* Check resulted Library and data sets */
proc contents data=json._all_; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 09:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665730#M199101</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2020-06-29T09:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665734#M199102</link>
      <description>&lt;P&gt;Why proc json? Have you tried this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename RAW "c:\temp\raw.json";

proc http&amp;nbsp;method = "get"
          url    = "https://.......json"
          out    = RAW;
run;

libname X json fileref=RAW ;

proc copy in=X out=WORK;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 10:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665734#M199102</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-06-29T10:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665739#M199103</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13868"&gt;@AhmedAl_Attar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nice code!&lt;/P&gt;
&lt;P&gt;The strip() function does nothing as used though.&lt;/P&gt;
&lt;P&gt;Also, if you want you can have a single line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	do until (EOF);
		input;
		LINE = cats( _infile_, ifc(EOF,,',') );
		put LINE;
	end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 10:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665739#M199103</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-06-29T10:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665743#M199104</link>
      <description>Thank you Ahmed. It works!!!</description>
      <pubDate>Mon, 29 Jun 2020 10:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665743#M199104</guid>
      <dc:creator>ndhaubhadel</dc:creator>
      <dc:date>2020-06-29T10:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading NDJSON (Newline Delimited JSON).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665745#M199106</link>
      <description>Thanks, Will keep it in mind &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 29 Jun 2020 10:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-NDJSON-Newline-Delimited-JSON/m-p/665745#M199106</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2020-06-29T10:59:59Z</dc:date>
    </item>
  </channel>
</rss>

