Date: Sat, 15 Oct 2005 13:37:42 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: working on data set
Actually, it can be simplified to
data work.test;
if _n_=1 and eof then output;
set work.class end=eof;
output;
run;
On Thu, 13 Oct 2005 14:06:43 -0700, data _null_; <datanull@GMAIL.COM> wrote:
>Perhaps this program is close to what you want. If the data set
>work.class has zero observations the second data step writes one obs.
>with all missing values. If work.class has greater than zero
>observations the data step copies work.class to work.test.
>
>data work.class;
> set sashelp.class;
> stop; /* remove this statement to test with GT 0 obs */
> run;
>
>data work.test;
> if _n_=1 and eof then output;
> do while(not eof);
> set work.class end=eof;
> output;
> end;
> stop;
> run;
>proc print;
> run;
|