[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Thanks RE: BY var Qn.
From:       Jeff Morison <jmt_mtf () YAHOO ! COM>
Date:       2002-10-31 20:47:59
[Download RAW message or body]

   Thanks for all your replies, much appreciated.




--- "Fehd, Ronald J. (PHPPO)" <rjf2@cdc.gov> wrote:
> > From: Jeff Morison [mailto:jmt_mtf@YAHOO.COM]
> >
> > I have a dataset with multiple records for a each
> new
> > value of the variable, I need to grab the first 4
> > records for each different value of the variable.
> >
> > How can I do that?.
>
> data FIRST4;
> set  DATA;
> by   Var;
> if   first.Var then Cntr=1;
> else                Cntr++1;;
> if   Cntr le 4 then output;
>
> Ron Fehd  the macro maven  CDC Atlanta GA USA
> RJF2@cdc.gov
>
> --> cheerful provider of UNTESTED SAS code from the
> Clue?Gee!Wrx <--
>
> "Nothing is particularly hard
> if you divide it into small jobs."
> - Henry Ford, Industrialist
>


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic