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 (November 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: sas-l@uga.edu
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


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