Date: Sat, 22 Mar 2003 18:57:09 +0000
Reply-To: sashole@bellsouth.net
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject: Re: Limiting BY observations
Content-Type: text/plain; format=flowed
David,
If printing the thing is a one-time operation, then I would create a view
and then print from it. Of course, if you are planning on reading the
by-castrated file considerably more than once thereafter, replace the view
with a data file.
data to_print / view = to_print ;
do _n_ = 1 by 1 until ( last . by_variable ) ;
set input_sas_file ;
by by_variable ;
if _n_ <= 10 then output ;
end ;
run ;
proc print data = to_print ;
run ;
Kind regards,
-------------------
Paul M. Dorfman
Jacksonville, FL
-------------------
>From: David Kellerman <kellermandavid@YAHOO.COM>
>
>I want to print only the 1st 10 observations in each BY group. Any
>suggestions.
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail