| Date: | Fri, 9 Nov 2007 08:32:15 -0800 |
| Reply-To: | Eric Hoogenboom <erichoogenboom@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Eric Hoogenboom <erichoogenboom@YAHOO.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: count obs by variable |
|
| In-Reply-To: | <1194623676.815530.193300@o3g2000hsb.googlegroups.com> |
| Content-Type: | text/plain; charset="us-ascii" |
|---|
Phil,
Use the By statement from Proc Sort in the datastep.
Then use the automatic first. variable and retain to perform a count
per timestep.
Something like (untested):
data top;
set all;
by year timestep descending score;
retain count;
if first.timestep then count=0;
count=count+1;
/* 2nd option */
if count <= 4000 then output;
run;
Hth,
Eric
|