<?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 do I select top 5 obs ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837709#M331239</link>
    <description>I appreciate your help, this solution worked!! Thank you for your time</description>
    <pubDate>Mon, 10 Oct 2022 17:00:23 GMT</pubDate>
    <dc:creator>LMSSAS</dc:creator>
    <dc:date>2022-10-10T17:00:23Z</dc:date>
    <item>
      <title>How do I select top 5 obs ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837670#M331230</link>
      <description>&lt;P&gt;I have the following output (see visual below SAS code) and I want to select the Top 5 obs for each manager. Can someone advise how to solve for this?&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; create table DSNP_Agents1_Chart as  
select distinct
a.county,
sum(a.mbr_end_inv) as Total,
a.Broker_Manager
From DSNP_Agents1 a
group by county, Broker_manager
order by Total desc 
;quit;

proc sort data=DSNP_Agents1_Chart; 
by Broker_manager;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMSSAS_0-1665412822159.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76054i0A242A96C668A22C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LMSSAS_0-1665412822159.png" alt="LMSSAS_0-1665412822159.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837670#M331230</guid>
      <dc:creator>LMSSAS</dc:creator>
      <dc:date>2022-10-10T14:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select top 5 obs ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837671#M331231</link>
      <description>&lt;P&gt;Perhaps PROC RANK could help you?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837671#M331231</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-10-10T14:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select top 5 obs ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837673#M331232</link>
      <description>&lt;P&gt;One way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=sashelp.iris out=rank descending ties=low;
   by species;
   var SepalLength;
   ranks r;
run;
 
proc sort data=rank out=want(drop = r);
   where r &amp;lt;= 3;
   by species r;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837673#M331232</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-10T15:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select top 5 obs ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837709#M331239</link>
      <description>I appreciate your help, this solution worked!! Thank you for your time</description>
      <pubDate>Mon, 10 Oct 2022 17:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837709#M331239</guid>
      <dc:creator>LMSSAS</dc:creator>
      <dc:date>2022-10-10T17:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select top 5 obs ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837710#M331240</link>
      <description>Thank you!</description>
      <pubDate>Mon, 10 Oct 2022 17:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-select-top-5-obs/m-p/837710#M331240</guid>
      <dc:creator>LMSSAS</dc:creator>
      <dc:date>2022-10-10T17:00:42Z</dc:date>
    </item>
  </channel>
</rss>

