<?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 get last 10 obs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595096#M171134</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a large dataset I don't know how many rows it has. I want its last 10 obs. Can I to do it in one data step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data want;

set bigdata(firstobs=max-9);

run;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 15:07:30 GMT</pubDate>
    <dc:creator>GeorgeSAS</dc:creator>
    <dc:date>2019-10-09T15:07:30Z</dc:date>
    <item>
      <title>get last 10 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595096#M171134</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a large dataset I don't know how many rows it has. I want its last 10 obs. Can I to do it in one data step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data want;

set bigdata(firstobs=max-9);

run;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595096#M171134</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2019-10-09T15:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: get last 10 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595099#M171136</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  do p=max(1,nobs-9) to nobs;
    set bigdata nobs=nobs point=p;
    output;
  end;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 15:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595099#M171136</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-09T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: get last 10 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595345#M171243</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set sashelp.class nobs=nobs;
 if _n_&amp;gt;nobs-10;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595345#M171243</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-10-10T12:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: get last 10 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595369#M171253</link>
      <description>Thanks, this work on small data but it will take long time on big data</description>
      <pubDate>Thu, 10 Oct 2019 13:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/595369#M171253</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2019-10-10T13:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: get last 10 obs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/683688#M207102</link>
      <description>&lt;P&gt;Better solution is to figure out the total number of observations in your data using proc contents.&amp;nbsp; Then in proc print use firstobs=number of obs - 10 instead of obs=10.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 15:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-last-10-obs/m-p/683688#M207102</guid>
      <dc:creator>srikanth421</dc:creator>
      <dc:date>2020-09-14T15:07:42Z</dc:date>
    </item>
  </channel>
</rss>

