<?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: How to import all observations from an one record infile (@@ is not enougth) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203855#M15252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data dataset1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile '/local/arquivo_1.txt' dlm='{[,:"} ;';&lt;/P&gt;&lt;P&gt;length varn varn_conts $20 ;&lt;/P&gt;&lt;P&gt;Do case = 1 by 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varn Varn_conts @ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If varn = " " then input ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Else output ;&lt;/P&gt;&lt;P&gt;End ;&lt;/P&gt;&lt;P&gt;stop ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2015 22:50:29 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2015-03-17T22:50:29Z</dc:date>
    <item>
      <title>How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203852#M15249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a txt file with all my observation in just one record, similiar to this:&lt;/P&gt;&lt;P&gt;[{"Var1":"a1234","Var2":"a567","var3":0,"var4":0},{"Var1":"b1234","Var2":"b567","var3":1,"var4":0},{"Var1":"c1234","Var2":"c567","var3":0,"var4":0}, ..............................................]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to import its content to a dataset. But even using double trailing I just end up with 2 observations (the txt file has something about 20,000 observations). This is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dataset1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile '/local/arquivo_1.txt' dlm='{[,:"} ;';&lt;/P&gt;&lt;P&gt;&amp;nbsp; input var1 $ Var1_content : $9. var2 : $12. Var2_content : $12. var3 : $16.&amp;nbsp; Var3_content $ var4 : $12. Var4_content $ @@;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 20:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203852#M15249</guid>
      <dc:creator>TanaraRose</dc:creator>
      <dc:date>2015-03-17T20:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203853#M15250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a LRECL option to the INFILE statement.&amp;nbsp; You should be able to set it to a billion (1 with 9 zeros).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesn't work then read the file using STREAM input and convert all of the '}' to '0A'x and then the line lengths will be shorter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 20:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203853#M15250</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-03-17T20:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203854#M15251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this was a one-time project I would be very tempted to use and editor to replace the string &lt;STRONG&gt;},&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with &lt;STRONG&gt;}&amp;lt;new line&amp;gt; &lt;/STRONG&gt;where new line is the appropriate one for your OS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 21:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203854#M15251</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-17T21:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203855#M15252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data dataset1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile '/local/arquivo_1.txt' dlm='{[,:"} ;';&lt;/P&gt;&lt;P&gt;length varn varn_conts $20 ;&lt;/P&gt;&lt;P&gt;Do case = 1 by 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varn Varn_conts @ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If varn = " " then input ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Else output ;&lt;/P&gt;&lt;P&gt;End ;&lt;/P&gt;&lt;P&gt;stop ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 22:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203855#M15252</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2015-03-17T22:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203856#M15253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the original file JSON?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 02:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203856#M15253</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-18T02:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203857#M15254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is JSON file which is a stream file , You need to tell SAS it is a stream file by defining recfm=n ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data dataset1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; infile '/local/arquivo_1.txt' dlm='{[,:"} ;'&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;recfm=n&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; input var1 $ Var1_content : $9. var2 : $12. Var2_content : $12. var3 : $16.&amp;nbsp; Var3_content $ var4 : $12. Var4_content $ @@;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 13:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203857#M15254</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-18T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to import all observations from an one record infile (@@ is not enougth)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203858#M15255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Tom! It worked perfectly &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 14:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-all-observations-from-an-one-record-infile-is-not/m-p/203858#M15255</guid>
      <dc:creator>TanaraRose</dc:creator>
      <dc:date>2015-03-18T14:43:04Z</dc:date>
    </item>
  </channel>
</rss>

