<?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 in json data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362163#M85525</link>
    <description>&lt;P&gt;If you're using SAS 9.4 you might find the JSON library engine much easier to use than trying to parse it yourself. The details are&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n1jfdetszx99ban1rl4zll6tej7j.htm" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 27 May 2017 09:43:18 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-05-27T09:43:18Z</dc:date>
    <item>
      <title>reading in json data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362036#M85483</link>
      <description>&lt;P&gt;here is the error when I read this data. there are no observations. Why ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;filename data '\\kashmir\BFD\sample_json1_may26.txt';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;6300&amp;nbsp; data datatest;&lt;BR /&gt;6301&amp;nbsp;&amp;nbsp; infile data lrecl = 32000 truncover scanover;&lt;BR /&gt;6302&amp;nbsp;&amp;nbsp; input @'"text": "' text $255. @'"from_user": "' from_user $255. @'"created_at": "' created_at&lt;BR /&gt;6302! $255. ;&lt;BR /&gt;6303&amp;nbsp; /*text = substr(text,1,index(text,'",')-2); from_user = substr( from_user,1,index(&lt;BR /&gt;6303! from_user,'",')-2);&lt;BR /&gt;6304&amp;nbsp; created_at = substr(created_at,1,index(created_at,'",')-2); run;&lt;BR /&gt;6305&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;NOTE: The infile DATA is:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=\\kashmir\BFD\sample_json1_may26.txt,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=32000,File Size (bytes)=1989,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=26May2017:12:28:24,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=26May2017:12:09:11&lt;/P&gt;&lt;P&gt;NOTE: 3 records were read from the infile DATA.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 1.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 1134.&lt;BR /&gt;NOTE: SAS went to a new line when INPUT @'CHARACTER_STRING' scanned past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.DATATEST has 0 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;6306&amp;nbsp; proc print data=dataset;run;&lt;BR /&gt;ERROR: File WORK.DATASET.DATA does not exist.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 16:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362036#M85483</guid>
      <dc:creator>rboire</dc:creator>
      <dc:date>2017-05-26T16:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: reading in json data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362103#M85511</link>
      <description>&lt;P&gt;Without actually seeing the data file here is something to check:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using the Input @'text value' then the value you supply in the code must be exactly as it appears in the source file.&lt;/P&gt;
&lt;P&gt;If the file has "Text value" then it does not match 'text value'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the "Minimum record length was 1" may indicate you don't even want to attempt the read the first line. Perhaps add "firstobs=2" to accomplish that.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 23:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362103#M85511</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-26T23:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: reading in json data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362163#M85525</link>
      <description>&lt;P&gt;If you're using SAS 9.4 you might find the JSON library engine much easier to use than trying to parse it yourself. The details are&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n1jfdetszx99ban1rl4zll6tej7j.htm" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 09:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-json-data/m-p/362163#M85525</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-05-27T09:43:18Z</dc:date>
    </item>
  </channel>
</rss>

