Date: Thu, 27 Mar 2008 12:22:08 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Conditional fsedit
On Thu, 27 Mar 2008 10:47:11 -0500, Masuod Pajoh <mpajoh@ODOT.ORG> wrote:
>How can I do an FSEDIT only when the data set has observations?
>
>Masoud
You can use a macro for that (untested):
%macro ed(ds);
%let nobs=0;
data _null_;
set &ds;
call symput("nobs",_n_);
stop;
run;
%if &nobs=0 %then %do;
%put no data in &ds;
%end;
%else %do;
proc fsedit data=&ds;
run;
%end;
%mend;
data test;
stop;
run;
%ed(test);
data test;
x=1;
run;
%ed(test);