Date: Wed, 23 Dec 1998 08:55:41 -0500
Reply-To: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Organization: ICGNetcom
Subject: Re: Conditional processing of a data step
Using the same line of thought, you can conditionally execute a block of
statements.
data _null_;
if symget("<a status macro variable>") = "<the skip block condition>" then
call symput('skip',' ');
else
call symput('skip','*');
run;
&skip/*;
<block of statements not containing /**/ comments>
*/;
when skip=* the block will run,
when skip=<blank> the block will become a /* */ comment.
Rich DeVenezia
> Here's another one.................(exsw is 'external switch')
>
>160 %let exsw=Y;
>161
>162 data _null_;
>163 if "&exsw" = 'N' then call symput('stop','STOP;');
>164 else call symput('stop','*CONTIMUE;');
>165 run;
>
>NOTE: The DATA statement used 0.01 CPU seconds and 5140K.
>
>166
>167 data _null_;
>168 &stop
>169 put 'THE STEP RUNS';
>170 run;
>
>THE STEP RUNS
>NOTE: The DATA statement used 0.01 CPU seconds and 5140K.
|