<?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 N Values in Proc Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714422#M220560</link>
    <description>&lt;P&gt;We would be using PROC REPORT to print the values out.&amp;nbsp; We would use PROC RANK or PROC SORT to order the values.&amp;nbsp; The method we use to select either the first highest N or, another way, to select those records with the lowest rank status will be our use of "SAS dataset option syntax".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;data = &amp;lt;dsname&amp;gt; (obs=n) &lt;BR /&gt;                 ------&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc report data=rank_report(where=(rankstatus&amp;lt;=5));
                             ----------------------&lt;/LI-CODE&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 26 Jan 2021 21:14:16 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2021-01-26T21:14:16Z</dc:date>
    <item>
      <title>Top N Values in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714168#M220440</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data rank;
input id marks;
cards;
1 22
2 33
3 45
4	23
5	23
6	80
7	85
8	46
9	60
10 60
;
run;

proc rank data=rank out=rank_report descending
ties=	high;
var marks;
ranks rankstatus;
run; 

proc report data=rank ;
column id marks status;
define id /display;
define marks/analysis ;
compute after status
marks order by descending;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to find top N values using proc report&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714168#M220440</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-01-26T07:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Top N Values in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714171#M220443</link>
      <description>&lt;P&gt;The easiest way is to sort by descending value and select by&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; data = &amp;lt;dsname&amp;gt; (obs=n)&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714171#M220443</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-26T07:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Top N Values in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714226#M220477</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=rank_report(where=(rankstatus&amp;lt;=5));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 11:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714226#M220477</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-26T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Top N Values in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714422#M220560</link>
      <description>&lt;P&gt;We would be using PROC REPORT to print the values out.&amp;nbsp; We would use PROC RANK or PROC SORT to order the values.&amp;nbsp; The method we use to select either the first highest N or, another way, to select those records with the lowest rank status will be our use of "SAS dataset option syntax".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;data = &amp;lt;dsname&amp;gt; (obs=n) &lt;BR /&gt;                 ------&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc report data=rank_report(where=(rankstatus&amp;lt;=5));
                             ----------------------&lt;/LI-CODE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-Values-in-Proc-Report/m-p/714422#M220560</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-01-26T21:14:16Z</dc:date>
    </item>
  </channel>
</rss>

