LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 4 Oct 1999 09:39:17 -0400
Reply-To:     Victor Kamensky <kamensky@AECOM.YU.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Victor Kamensky <kamensky@AECOM.YU.EDU>
Subject:      Re: finding a maximum value,Second  Max, Third Max etc..
Comments: To: SAS-L@UGA.CC.UGA.EDU
Content-Type: text/plain; charset="us-ascii"

>This will run faster: >PROC SORT DATA= payouts ;by DESCENDING amount;run; >PROC PRINT DATA= p (OBS=1); > var amount; > RUN ; Sure it will. And it is the simpliest way to solve the problem of the Second maximum, Third maximum etc..: %let nummax=8; PROC SORT DATA= payouts ;by DESCENDING amount;run; PROC PRINT DATA= payouts (OBS=&nummax); var amount; RUN ; Victor Kamensky Programmer Albert Einstein College of Medicine

>From: KarlGerber@aol.com >Date: Sat, 2 Oct 1999 09:15:10 EDT >Subject: Re: finding a maximum value >To: kamensky@aecom.yu.edu >X-Mailer: AOL 4.0 for Windows 95 sub 26 > >In a message dated 9/30/99 6:05:30 PM Eastern Daylight Time, >kamensky@AECOM.YU.EDU writes: > >> PROC SORT DATA= payouts ;by amount;run; >> data p; set payouts end=last; >> if last; >> run; >> PROC PRINT DATA= p ; >> var amount; >> RUN ; > >This will run faster: >PROC SORT DATA= payouts ;by DESCENDING amount;run; >PROC PRINT DATA= p (OBS=1); > var amount; > RUN ; > >Regards > >Karl Gerber > >


Back to: Top of message | Previous page | Main SAS-L page