<?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: Equivalent of Excel's &amp;quot;Large&amp;quot; function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85867#M289069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another method I found in my code repository.&amp;nbsp; The previous example output to variables with a prefix of reordered.&amp;nbsp; The below will sort and output to the variables with a X prefix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;ARRAY A{25} X1-X25;&lt;/P&gt;&lt;P&gt;** SET SORT PARAMETERS ;&lt;/P&gt;&lt;P&gt;SEQ = "A" ; * A = ASCENDING, D = DESCENDING ;&lt;/P&gt;&lt;P&gt;NODUPKEY = 0 ; * 0 = DUPLICATES ALLOWED, 1 = DUPLICATES NOT ALLOWED ;&lt;/P&gt;&lt;P&gt;DCL HASH HH (HASHEXP: 0, ORDERED: SEQ) ;&lt;/P&gt;&lt;P&gt;DCL HITER HI ("HH") ;&lt;/P&gt;&lt;P&gt;HH.DEFINEKEY ("K","N") ; * N - EXTRA ENUMERATING KEY ;&lt;/P&gt;&lt;P&gt;HH.DEFINEDATA ("K") ; * K AUTOMATICALLY ASSUMES ARRAY DATA TYPE ;&lt;/P&gt;&lt;P&gt;HH.DEFINEDONE ( ) ;&lt;/P&gt;&lt;P&gt;** LOAD COMPOSITE (K N) KEY ON THE TABLE ;&lt;/P&gt;&lt;P&gt;** IF DUPLICATES TO BE RETAINED, SET 0 &amp;lt;- N ;&lt;/P&gt;&lt;P&gt;DO J = LBOUND (A) TO HBOUND (A) ;&lt;/P&gt;&lt;P&gt;N = J * ^ NODUPKEY ;&lt;/P&gt;&lt;P&gt;K = A {J} ;&lt;/P&gt;&lt;P&gt;HH.REPLACE() ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;** USE ITERATOR HI TO RELOAD ARRAY FROM HH TABLE, NOW IN ORDER ;&lt;/P&gt;&lt;P&gt;N = LBOUND (A) - 1 ;&lt;/P&gt;&lt;P&gt;DO RC = HI.FIRST() BY 0 WHILE ( RC = 0 ) ;&lt;/P&gt;&lt;P&gt;N = N + 1 ;&lt;/P&gt;&lt;P&gt;A {N} = K ;&lt;/P&gt;&lt;P&gt;RC = HI.NEXT() ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;Q = N ;&lt;/P&gt;&lt;P&gt;** FILL ARRAY TAIL WITH MISSING VALUES IF DUPLICATES ARE DELETE ;&lt;/P&gt;&lt;P&gt;DO N = Q + 1 TO HBOUND (A) ;&lt;/P&gt;&lt;P&gt;A {N} = . ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;** CHECK IF ARRAY IS NOW SORTED ;&lt;/P&gt;&lt;P&gt;SORTED = 1 ;&lt;/P&gt;&lt;P&gt;DO N = LBOUND (A) + 1 TO Q WHILE ( SORTED ) ;&lt;/P&gt;&lt;P&gt;IF A {N - 1} &amp;gt; A {N} THEN SORTED = 0 ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;PUT SORTED = ;&lt;/P&gt;&lt;P&gt;KEEP X:;&lt;/P&gt;&lt;P&gt;RUN ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Sep 2013 11:26:37 GMT</pubDate>
    <dc:creator>Scott_Mitchell</dc:creator>
    <dc:date>2013-09-18T11:26:37Z</dc:date>
    <item>
      <title>Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85865#M289067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to find the equivalent of Excel's large function which returns the k'th largest element in a list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the following: "Given a dataset with, say, 10^6 observations and 25 variables return the kth largest element for variables x1 to x25."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried a few things with proc sort, proc rank, data steps (obs=, firstobs=), _N_, some sql code. I also tried percentiles, but none of the percentiles options (there are 5 different ones) do exactly correspond to the kth largest element.&lt;/P&gt;&lt;P&gt;Thus, none of the solutions I tried are really satisfying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main issues I have are:&lt;/P&gt;&lt;P&gt;1. I do not want to execute some code (say a macro) for each of the variables. Let's say I do not want to sort my data set 25 times. This is to slow.&lt;/P&gt;&lt;P&gt;2. Proc Rank seems to work reasonably fast and it can work on all of the variables at the same time. However, none of the TIES= options suits my needs, since I want the ranks to be 1,2,3,4,..., 999999, 1000000 (simply 1-n all integers without interleaving any numbers)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me with that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I timed my code again. It turns out that sorting 25 times (for all different variables) takes about 9 seconds (using "sasfile ds open"). I think I can actually live with that. Even though proc rank can give me all the ranks in 2.5 seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bernhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 10:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85865#M289067</guid>
      <dc:creator>bernhard</dc:creator>
      <dc:date>2013-09-18T10:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85866#M289068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bernhard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The largest function will identify the nth largest value from a set of variables you specify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;LARGEST = LARGEST(1,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X23,X24,X25);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which can be consolidated to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;LARGEST = LARGEST(1,of X1-X25);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use an array to resort the values, that way the value in x5 is always the 5th largest of each observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TWO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; KEEP REORDERED:;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET HAVE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ARRAY X(25);&lt;/P&gt;&lt;P&gt;&amp;nbsp; ARRAY REORDERED(25);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DO K=1 TO 25;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REORDERED(K)=largest(K, OF X1-X25); &lt;/P&gt;&lt;P&gt;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 10:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85866#M289068</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-18T10:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85867#M289069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another method I found in my code repository.&amp;nbsp; The previous example output to variables with a prefix of reordered.&amp;nbsp; The below will sort and output to the variables with a X prefix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;ARRAY A{25} X1-X25;&lt;/P&gt;&lt;P&gt;** SET SORT PARAMETERS ;&lt;/P&gt;&lt;P&gt;SEQ = "A" ; * A = ASCENDING, D = DESCENDING ;&lt;/P&gt;&lt;P&gt;NODUPKEY = 0 ; * 0 = DUPLICATES ALLOWED, 1 = DUPLICATES NOT ALLOWED ;&lt;/P&gt;&lt;P&gt;DCL HASH HH (HASHEXP: 0, ORDERED: SEQ) ;&lt;/P&gt;&lt;P&gt;DCL HITER HI ("HH") ;&lt;/P&gt;&lt;P&gt;HH.DEFINEKEY ("K","N") ; * N - EXTRA ENUMERATING KEY ;&lt;/P&gt;&lt;P&gt;HH.DEFINEDATA ("K") ; * K AUTOMATICALLY ASSUMES ARRAY DATA TYPE ;&lt;/P&gt;&lt;P&gt;HH.DEFINEDONE ( ) ;&lt;/P&gt;&lt;P&gt;** LOAD COMPOSITE (K N) KEY ON THE TABLE ;&lt;/P&gt;&lt;P&gt;** IF DUPLICATES TO BE RETAINED, SET 0 &amp;lt;- N ;&lt;/P&gt;&lt;P&gt;DO J = LBOUND (A) TO HBOUND (A) ;&lt;/P&gt;&lt;P&gt;N = J * ^ NODUPKEY ;&lt;/P&gt;&lt;P&gt;K = A {J} ;&lt;/P&gt;&lt;P&gt;HH.REPLACE() ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;** USE ITERATOR HI TO RELOAD ARRAY FROM HH TABLE, NOW IN ORDER ;&lt;/P&gt;&lt;P&gt;N = LBOUND (A) - 1 ;&lt;/P&gt;&lt;P&gt;DO RC = HI.FIRST() BY 0 WHILE ( RC = 0 ) ;&lt;/P&gt;&lt;P&gt;N = N + 1 ;&lt;/P&gt;&lt;P&gt;A {N} = K ;&lt;/P&gt;&lt;P&gt;RC = HI.NEXT() ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;Q = N ;&lt;/P&gt;&lt;P&gt;** FILL ARRAY TAIL WITH MISSING VALUES IF DUPLICATES ARE DELETE ;&lt;/P&gt;&lt;P&gt;DO N = Q + 1 TO HBOUND (A) ;&lt;/P&gt;&lt;P&gt;A {N} = . ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;** CHECK IF ARRAY IS NOW SORTED ;&lt;/P&gt;&lt;P&gt;SORTED = 1 ;&lt;/P&gt;&lt;P&gt;DO N = LBOUND (A) + 1 TO Q WHILE ( SORTED ) ;&lt;/P&gt;&lt;P&gt;IF A {N - 1} &amp;gt; A {N} THEN SORTED = 0 ;&lt;/P&gt;&lt;P&gt;END ;&lt;/P&gt;&lt;P&gt;PUT SORTED = ;&lt;/P&gt;&lt;P&gt;KEEP X:;&lt;/P&gt;&lt;P&gt;RUN ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 11:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85867#M289069</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-18T11:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85868#M289070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your first answer. I have noticed this function as well. But it is not doing what I want.&lt;/P&gt;&lt;P&gt;Cons&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ider the dataset sashelp.cars. Say I want to find the 5th largest value of cylinders. The result should be 10. Since there are three observations with 12 cylinders and two with 10 cylinders.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I take you code for this example, I get an error (the error is obvious to me since the function is built for a different use case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET sashelp.cars;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LARGEST = LARGEST(5,cylinders);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to have&amp;nbsp; a look at the second answer.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 11:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85868#M289070</guid>
      <dc:creator>bernhard</dc:creator>
      <dc:date>2013-09-18T11:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85869#M289071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For now I have settled with a macro (see below).&lt;/P&gt;&lt;P&gt;I cannot get rid of the feelign that there is a nicer way to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro large(data=ds,out=out,k=,vars=_all_);&lt;/P&gt;&lt;P&gt;/*returns the kth largest values*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%local i nm;&lt;/P&gt;&lt;P&gt;proc datasets nolist;delete __temp:;quit;&lt;/P&gt;&lt;P&gt;data __temp__;set &amp;amp;data.(keep=&amp;amp;vars. obs=1);run;&lt;/P&gt;&lt;P&gt;proc contents noprint data=__temp__ out=__cont__(keep=name);quit;&lt;/P&gt;&lt;P&gt;proc sql noprint;select name into: _varlist_ separated by " " from __cont__;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sasfile &amp;amp;data. open;&lt;/P&gt;&lt;P&gt;%do i=1 %to %sysfunc(countw(&amp;amp;_varlist_.));&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let nm=%scan(&amp;amp;_varlist_.,&amp;amp;i.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sort data=&amp;amp;data. out=__temp__(keep=&amp;amp;nm.);by descending &amp;amp;nm.;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do j=1 %to %sysfunc(countw(&amp;amp;k.));&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let kk=%scan(&amp;amp;k.,&amp;amp;j.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if &amp;amp;j. eq 1 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data __temp___&amp;amp;i.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format k 14.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set __temp__(obs=&amp;amp;kk. firstobs=&amp;amp;kk.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; k=&amp;amp;kk.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data __temp&amp;amp;kk.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format k 14.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set __temp__(obs=&amp;amp;kk. firstobs=&amp;amp;kk.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; k=&amp;amp;kk.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc append base=__temp___&amp;amp;i. data=__temp&amp;amp;kk.;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;data &amp;amp;out.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge __temp___:;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by k;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;sasfile &amp;amp;data. close;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%large(data=import2,k=10 100 1000);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 11:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85869#M289071</guid>
      <dc:creator>bernhard</dc:creator>
      <dc:date>2013-09-18T11:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85870#M289072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just out of curiosity would proc rank help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 12:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85870#M289072</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-09-18T12:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85871#M289073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note quite. Although proc rank is very efficient, I have not found a way with proc rank to number all observations by 1..... n . Although it can handle tied ranks (where multiple observations have the same value) in various ways, none of the options for TIES= does what I want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 13:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85871#M289073</guid>
      <dc:creator>bernhard</dc:creator>
      <dc:date>2013-09-18T13:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent of Excel's "Large" function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85872#M289074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on what K is, ie fixed or dynamic perhaps the extreme values section of Proc univariate can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect058.htm" title="http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect058.htm"&gt;Base SAS(R) 9.2 Procedures Guide: Statistical Procedures, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly ties are counted as multiple occurrences, so it may not help either. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title 'Extreme Blood Pressure Values';&lt;/P&gt;&lt;P&gt;ods select ExtremeValues;&lt;/P&gt;&lt;P&gt;proc univariate data=BPressure nextrval=5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var Systolic Diastolic;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 14:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Equivalent-of-Excel-s-quot-Large-quot-function/m-p/85872#M289074</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-09-18T14:48:56Z</dc:date>
    </item>
  </channel>
</rss>

