<?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: TOP 10 Records in a group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274919#M54919</link>
    <description>&lt;P&gt;Hi Aarathi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could try do loops as below, i took the example of shoes dataset. Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.shoes out=shoes;
by region descending stores ;
run;

data shoes_;
i=0;
do until(last.region);
set shoes;
by region descending stores ;
i+1;
if i &amp;lt;=10 then 
output;
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Jun 2016 12:05:07 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2016-06-03T12:05:07Z</dc:date>
    <item>
      <title>TOP 10 Records in a group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274911#M54915</link>
      <description>&lt;P&gt;Can any explain me how to filter top n rows in a particular group. for example for Each zone , top 10 locations need to be filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 10:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274911#M54915</guid>
      <dc:creator>aarathi</dc:creator>
      <dc:date>2016-06-03T10:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 10 Records in a group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274913#M54916</link>
      <description>&lt;P&gt;Sort by zone and the selection criteria (descending).&lt;/P&gt;
&lt;P&gt;Then do;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by zone;
retain counter;
if first.zone
then counter = 1;
else counter + 1;
if counter le 10;
drop counter;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 10:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274913#M54916</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-03T10:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 10 Records in a group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274919#M54919</link>
      <description>&lt;P&gt;Hi Aarathi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could try do loops as below, i took the example of shoes dataset. Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.shoes out=shoes;
by region descending stores ;
run;

data shoes_;
i=0;
do until(last.region);
set shoes;
by region descending stores ;
i+1;
if i &amp;lt;=10 then 
output;
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 12:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/TOP-10-Records-in-a-group/m-p/274919#M54919</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-06-03T12:05:07Z</dc:date>
    </item>
  </channel>
</rss>

