<?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 5 values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21205#M4461</link>
    <description>Searching the forums you'll find several threads dealing with this question.</description>
    <pubDate>Sat, 23 Oct 2010 00:34:04 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2010-10-23T00:34:04Z</dc:date>
    <item>
      <title>Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21204#M4460</link>
      <description>I am having a dataset with variables empcode,empname,sal,designation&lt;BR /&gt;
I want to find out the top 5 salaries based on the designation.&lt;BR /&gt;
Designation is a group variable.&lt;BR /&gt;
Can anyone help me on this using datastep and proc sql;&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Siddhartha</description>
      <pubDate>Fri, 22 Oct 2010 23:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21204#M4460</guid>
      <dc:creator>Siddhartha</dc:creator>
      <dc:date>2010-10-22T23:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21205#M4461</link>
      <description>Searching the forums you'll find several threads dealing with this question.</description>
      <pubDate>Sat, 23 Oct 2010 00:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21205#M4461</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-10-23T00:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21206#M4462</link>
      <description>proc sql number outobs=5;&lt;BR /&gt;
create table kk as&lt;BR /&gt;
select * from sashelp.class desc group by designation order by sal descending;&lt;BR /&gt;
quit;</description>
      <pubDate>Mon, 25 Oct 2010 10:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21206#M4462</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2010-10-25T10:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21207#M4463</link>
      <description>Hi.&lt;BR /&gt;
Op means a group variable.(i.e. need every group's first five observations).&lt;BR /&gt;
I have two way, one is proc ,the other is data step;&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sort data=sashelp.class out=class;&lt;BR /&gt;
 by sex;&lt;BR /&gt;
run;&lt;BR /&gt;
ods select extremeobs;&lt;BR /&gt;
proc univariate data=class nextrobs=5;&lt;BR /&gt;
 by sex;&lt;BR /&gt;
 var weight;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=sashelp.class out=class;&lt;BR /&gt;
 by sex descending weight;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set class;&lt;BR /&gt;
 by sex;&lt;BR /&gt;
 if first.sex then id=0;&lt;BR /&gt;
 id+1;&lt;BR /&gt;
run;&lt;BR /&gt;
data result;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 where id in (1 2 3 4 5);&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 26 Oct 2010 04:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21207#M4463</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-10-26T04:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21208#M4464</link>
      <description>Just so that you will have one more choice take a look at the IDGROUP option on the OUTPUT statement in PROC MEANS/SUMMARY.</description>
      <pubDate>Tue, 26 Oct 2010 05:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21208#M4464</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-10-26T05:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Top 5 values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21209#M4465</link>
      <description>Thanks, Art Carpenter.&lt;BR /&gt;
I will take a look.&lt;BR /&gt;
:)</description>
      <pubDate>Thu, 28 Oct 2010 05:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Top-5-values/m-p/21209#M4465</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-10-28T05:09:09Z</dc:date>
    </item>
  </channel>
</rss>

