<?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: Using JSON libname engine to read JSON file that is NOT all on the same line... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501918#M133899</link>
    <description>&lt;P&gt;I've seen these types of JSONL files before -- you could use SAS DATA step to pass through the file and break up the larger collection into individual files, then point the JSON engine at each of those.&amp;nbsp; Then rejoin the data in DATA step or SQL.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Oct 2018 14:25:57 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2018-10-05T14:25:57Z</dc:date>
    <item>
      <title>Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501862#M133865</link>
      <description>So I have read in a supposed JSON file from a vendor and normally, when I get a JSON file, when viewing it, the data is all on one line. The JSON engine handles this just fine.&lt;BR /&gt;&lt;BR /&gt;However, the file I am receiving from this vendor, has it separated somehow, where each record shows on its own line. This is causing issues with the JSON engine. It tells me...&lt;BR /&gt;&lt;BR /&gt;ERROR: Invalid JSON in input near line 2 column 2: Unexpected characters found after valid JSON text.&lt;BR /&gt;&lt;BR /&gt;If I take just one line of data from the file, the JSON engine reads it perfectly, but it chokes on anything past the first line because I think it is possibly putting a CR/LF at the end of each line and this is causing the issue. Is there some type of option I can set with the JSON engine to tell it to ignore the characters at the end, or will I need to filter these out somehow via maybe an infile statement?&lt;BR /&gt;&lt;BR /&gt;Thank You.</description>
      <pubDate>Fri, 05 Oct 2018 12:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501862#M133865</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501869#M133869</link>
      <description>&lt;P&gt;That's a bit peculiar, most of the json files I have seen are formatted nicely to view in a text editor, so have end of lines.&amp;nbsp; Is there perhaps a non printed or special character in there?&amp;nbsp; Maybe something happened when transferring the file, maybe unix eof on windows or something like that.&amp;nbsp; Really stabbing in the dark here, I can find nothing on end of line for json causing an issue.&amp;nbsp; Can you perhaps post a few lines of the file, or the file.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501869#M133869</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-05T13:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501871#M133870</link>
      <description>Here are two lines. In looking at the file, it is missing some elements of a normal JSON file(at least one that I am used to seeing)...&lt;BR /&gt;&lt;BR /&gt;{"event":"ws_page_load","properties":{"time":1536988982,"distinct_id":"165dd2f00c2468-0bcb9b2618f4ee-a35346f-130980-165dd2f00c3c55","$browser":"Chrome","$browser_version":64,"$city":"Trumbull","$current_url":"&lt;A href="https://rgs-web-prod.fingerprintplay.com/teachers/login&amp;quot;,&amp;quot;$initial_referrer&amp;quot;:&amp;quot;$direct&amp;quot;,&amp;quot;$initial_referring_domain&amp;quot;:&amp;quot;$direct&amp;quot;,&amp;quot;$lib_version&amp;quot;:&amp;quot;2.18.0&amp;quot;,&amp;quot;$os&amp;quot;:&amp;quot;Windows&amp;quot;,&amp;quot;$region&amp;quot;:&amp;quot;Connecticut&amp;quot;,&amp;quot;$screen_height&amp;quot;:912,&amp;quot;$screen_width&amp;quot;:1368,&amp;quot;mp_country_code&amp;quot;:&amp;quot;US&amp;quot;,&amp;quot;mp_lib&amp;quot;:&amp;quot;web&amp;quot;,&amp;quot;mp_processing_time_ms&amp;quot;:1537014182964,&amp;quot;page_path&amp;quot;:&amp;quot;https://rgs-web-prod.fingerprintplay.com/teachers/login&amp;quot;,&amp;quot;user_agent&amp;quot;:&amp;quot;Mozilla/5.0" target="_blank"&gt;https://rgs-web-prod.fingerprintplay.com/teachers/login","$initial_referrer":"$direct","$initial_referring_domain":"$direct","$lib_version":"2.18.0","$os":"Windows","$region":"Connecticut","$screen_height":912,"$screen_width":1368,"mp_country_code":"US","mp_lib":"web","mp_processing_time_ms":1537014182964,"page_path":"https://rgs-web-prod.fingerprintplay.com/teachers/login","user_agent":"Mozilla/5.0&lt;/A&gt; (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36"}}&lt;BR /&gt;{"event":"ws_page_load","properties":{"time":1536988982,"distinct_id":"165dd2f00c2468-0bcb9b2618f4ee-a35346f-130980-165dd2f00c3c55","$browser":"Chrome","$browser_version":64,"$city":"Trumbull","$current_url":"&lt;A href="https://rgs-web-prod.fingerprintplay.com/teachers/login&amp;quot;,&amp;quot;$initial_referrer&amp;quot;:&amp;quot;$direct&amp;quot;,&amp;quot;$initial_referring_domain&amp;quot;:&amp;quot;$direct&amp;quot;,&amp;quot;$lib_version&amp;quot;:&amp;quot;2.18.0&amp;quot;,&amp;quot;$os&amp;quot;:&amp;quot;Windows&amp;quot;,&amp;quot;$region&amp;quot;:&amp;quot;Connecticut&amp;quot;,&amp;quot;$screen_height&amp;quot;:912,&amp;quot;$screen_width&amp;quot;:1368,&amp;quot;mp_country_code&amp;quot;:&amp;quot;US&amp;quot;,&amp;quot;mp_lib&amp;quot;:&amp;quot;web&amp;quot;,&amp;quot;mp_processing_time_ms&amp;quot;:1537014183057,&amp;quot;page_path&amp;quot;:&amp;quot;https://rgs-web-prod.fingerprintplay.com/teachers/login&amp;quot;,&amp;quot;user_agent&amp;quot;:&amp;quot;Mozilla/5.0" target="_blank"&gt;https://rgs-web-prod.fingerprintplay.com/teachers/login","$initial_referrer":"$direct","$initial_referring_domain":"$direct","$lib_version":"2.18.0","$os":"Windows","$region":"Connecticut","$screen_height":912,"$screen_width":1368,"mp_country_code":"US","mp_lib":"web","mp_processing_time_ms":1537014183057,"page_path":"https://rgs-web-prod.fingerprintplay.com/teachers/login","user_agent":"Mozilla/5.0&lt;/A&gt; (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36"}}</description>
      <pubDate>Fri, 05 Oct 2018 13:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501871#M133870</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T13:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501873#M133871</link>
      <description>As a note, those are the first two lines in the file.</description>
      <pubDate>Fri, 05 Oct 2018 13:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501873#M133871</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T13:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501882#M133877</link>
      <description>&lt;P&gt;Well, looking at those lines, one thing jumped out at me in the row:&lt;/P&gt;
&lt;PRE&gt;"$initial_ref... (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36"&lt;/PRE&gt;
&lt;P&gt;Doesn't appear to be a parameter:reponse.&amp;nbsp; Other than that I don't see a problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe someone else can chime in here.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501882#M133877</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-05T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501883#M133878</link>
      <description>Here is the note from the vendor about the return format...&lt;BR /&gt;&lt;BR /&gt;Return Format:&lt;BR /&gt;&lt;BR /&gt;One event per line, sorted by increasing timestamp. Each line is a valid JSON object although the return itself is valid JSON but instead JSONL. Timestamps are expressed in seconds since January 1, 1970 in your project's timezone, not UTC as a true epoch timestamp. For example, if your project is set to Pacific time, you would need to add 8 hours (or 7 hours if not in daylights savings time) (60 min * 60 secs * 8 hours) to the timestamp in order to convert this timestamp into UTC. This means that converting the raw exported timestamps using many epoch converters will result in representing times with the incorrect offset.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On a side note, is there a way to edit a previous post?</description>
      <pubDate>Fri, 05 Oct 2018 13:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501883#M133878</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T13:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501889#M133882</link>
      <description>&lt;P&gt;Click the gear icon in the top right of the post, you should be able to edit your own posts.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501889#M133882</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-05T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501893#M133885</link>
      <description>&lt;P&gt;Ahh, I was in some strangely formatted version of the site and wasn't seeing the gear icon. After closing my browser and reopening it, the site looks like it used to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, it seems like that the return is something called JSONL, which the JSON engine seems to have issues with. I'm wondering if there's some type of option in maybe a custom mapping file to let it know it's JSONL vs JSON.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501893#M133885</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T13:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501894#M133886</link>
      <description>&lt;P&gt;Ah, well that might be your answer.&amp;nbsp; JSONL appears to be a slight deviation from JSON, so its possible the JSON engine can't read it directly.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://jsonlines.org/" target="_blank"&gt;http://jsonlines.org/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You may need to read it some other way.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501894#M133886</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-05T13:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501907#M133896</link>
      <description>&lt;P&gt;Unfortunately yes, that is my answer. I just talked to SAS and the JSON engine specialist says it cannot read that type of file.&lt;BR /&gt;&lt;BR /&gt;Hopefully they have this on their to do list as it seems like only a small update would be needed to handle the shifting to a new line, As I mentioned, if I have a file with just one line, the JSON engine works perfectly, it just doesn't know what to do after it hit's the end of the first line.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501907#M133896</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T13:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501918#M133899</link>
      <description>&lt;P&gt;I've seen these types of JSONL files before -- you could use SAS DATA step to pass through the file and break up the larger collection into individual files, then point the JSON engine at each of those.&amp;nbsp; Then rejoin the data in DATA step or SQL.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 14:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501918#M133899</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-10-05T14:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSON libname engine to read JSON file that is NOT all on the same line...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501923#M133901</link>
      <description>&lt;P&gt;That's an interesting thought. Reading it in line by line, outputting each line to a temp file then using the JSON engine to read that file and append it to the current dataset. Only issue I can see is making sure I create a map file that has the max length of each field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may give this a shot. It sounds a lot easier that parsing the lines myself.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 14:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-JSON-libname-engine-to-read-JSON-file-that-is-NOT-all-on/m-p/501923#M133901</guid>
      <dc:creator>Chuck_IV4</dc:creator>
      <dc:date>2018-10-05T14:36:04Z</dc:date>
    </item>
  </channel>
</rss>

