<?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 many records in the raw data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279546#M56346</link>
    <description>&lt;P&gt;Found a Unix command to count number of lines in a file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wc -l filename&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you working on Unix?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 20:01:45 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-22T20:01:45Z</dc:date>
    <item>
      <title>how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279329#M56288</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I want use data step to read a very large raw data with &lt;U&gt;&lt;STRONG&gt;infile&lt;/STRONG&gt;&lt;/U&gt; statement.&lt;/P&gt;
&lt;P&gt;firstly I want to know how many rows in the file,if I only want to read the &lt;STRONG&gt;last&lt;/STRONG&gt; records, I can use firstobs=&lt;STRONG&gt;n&lt;/STRONG&gt; obs=&lt;STRONG&gt;n&lt;/STRONG&gt; option but I need to know the value of &lt;STRONG&gt;n&lt;/STRONG&gt; first.&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DATA&amp;nbsp;read_last_obs;&lt;BR /&gt;&amp;nbsp; INFILE&amp;nbsp;raw1&amp;nbsp; FIRSTOBS=9999999 OBS=9999999.;&lt;BR /&gt;&amp;nbsp; INPUT a $50.;&lt;BR /&gt;&amp;nbsp; RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279329#M56288</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-22T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279330#M56289</link>
      <description>&lt;P&gt;I don't think so, reading in a text file is a linear process, its starts at character 1 and runs to the end of the file. &amp;nbsp;Why can you not proces the data once its read in, even really big files shouldn't take that long? &amp;nbsp;Why would you want only a few observations from the end?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279330#M56289</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-06-22T13:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279331#M56290</link>
      <description>&lt;P&gt;Take a look at the END= INFILE option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279331#M56290</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-06-22T13:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279359#M56295</link>
      <description>&lt;P&gt;If you are working under Linux/Unix this can be done.&amp;nbsp; But the exact statements are beyond my Unix knowledge.&amp;nbsp; Here's the idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unix contains a "tail" command that lists end of a file.&amp;nbsp; Instead of listing it, the results can be piped to a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now combine all of this with an INFILE statement.&amp;nbsp; The INFILE statements contains the "tail" command, piping its results as part of the INFILE statement definition (rather than to a file).&amp;nbsp; The combination lets the INFILE statement retrieve the tail end of the data source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you indicate that this would be useful for you, I'm sure someone on the board can give you more specific code.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 14:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279359#M56295</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-22T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279366#M56298</link>
      <description>&lt;P&gt;I just want to get last row of record, this will save time and space if i know the total number &amp;nbsp;of rows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 14:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279366#M56298</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-22T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279546#M56346</link>
      <description>&lt;P&gt;Found a Unix command to count number of lines in a file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wc -l filename&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you working on Unix?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279546#M56346</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-22T20:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279609#M56369</link>
      <description>&lt;P&gt;working on z/os&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 02:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279609#M56369</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-23T02:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279622#M56371</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; DATA _null_;
  INFILE '/folders/myfolders/all_jd.csv' end=last;
  INPUT;
  n+1;
  if last then putlog 'NOTE: File have ' n ' rows.'/
                      'The last row is:' _infile_ ;
  RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2016 02:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/279622#M56371</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-23T02:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/282951#M57581</link>
      <description>Thank you Ksharp,&lt;BR /&gt;But your method need to read the whole raw file first, then counting the obs, while I don't want to read the whole file because time cost a lot!&lt;BR /&gt;Thanks!</description>
      <pubDate>Fri, 08 Jul 2016 13:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/282951#M57581</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-07-08T13:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: how many records in the raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/283100#M57655</link>
      <description>&lt;PRE&gt;
Maybe you should take a look at the function relate to FILE,
Like FGET(), FOPEN() .............

But I totally don't have any clue about it .

&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jul 2016 03:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-many-records-in-the-raw-data/m-p/283100#M57655</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-09T03:03:32Z</dc:date>
    </item>
  </channel>
</rss>

