|Date: ||Fri, 19 Jun 2009 07:45:20 -0500|
|Reply-To: ||Joe <snoopy369@GMAIL.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Joe <snoopy369@GMAIL.COM>|
|Subject: ||Re: outputting either the fourth or the final observation to a
|Content-Type: ||text/plain; charset=us-ascii; format=flowed; delsp=yes|
How about (untested):
do until (eof);
set a end=eof;
if _n_ =4 then leave;
On Jun 19, 2009, at 7:16 AM, Randall Powers <powers_r@BLS.GOV> wrote:
> Hello all,
> I have a temporary dataset A that is reproduced 10 times in the run
> of a
> program. Sometimes it happens that the dataset has four or more
> observations, sometimes it has less.
> If there are four or more observations in A, I want to output the
> observation to temporary dataset B. If there are less than four
> observations, I want you output the final observation of A to B.
> How do I do this?