Date: Thu, 8 May 2008 08:52:35 -0400
Reply-To: Tom Hide <tom.hide@DEHIWORLD.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Hide <tom.hide@DEHIWORLD.COM>
Subject: Re: How to retrieve observations whose sum <= a value
On Wed, 7 May 2008 23:41:18 -0700, abshakes <ab_shakes@YAHOO.COM.SG> wrote:
> I have a sorted dataset, from which I want to retrieve only those rows
whose sum <= a value.
> In other words I am trying to retrieve only the top n rows whose sum
> I will really appreciate any ideas on this....
> Many Thanks !!
>"I am not arrogant ... only better thaaaan yyyyou !!"
>Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
Assume your TEST data is as follows:
retain cnt 0 x 28;
if cnt gt x then stop;
CNT X Var Desc
12 28 12 Hhxhxhh
25 28 13 aHADHKHasKF
CNT will give you a running total for var.
X is your value
I am not sure if this is what you want, if not please supply some more
detailed information, together with sample data and expected results.