|
On Wed, 19 Sep 2007, Terjeson, Mark wrote:
> Ah, yes.
>
> Well, this ain't exactly pretty but
> have used this in the past for datasteps.
> You'll have to take other measures for
> procs and other open code. Also you would
> have to take measures for the dataset
> created by the STOPped datastep. i.e.
> remove it or not, etc.
>
>
> data one;
> run;
>
> data two;
> condition=1;
> if condition then
> do;
> call symput('MYSTATE',' cancel ');
> stop;
> end;
> run;
>
> data three;
> run &mystate;
>
> data four;
> run &mystate;
What? Yes, RUN CANCEL is a good construct, but why not just use a macro
wrapper, if you are using a macro variable at all and an appropriate
(global) command like ENDSAS is not available.
%macro continue_it ;
%if &MYSTATE. ne CANCEL %then
%do ;
data three ;
run ;
data four ;
run ;
%end ;
%mend continue_it ;
%continute_it
Of course, I would prefer a parameter list, but Richard is quite competent
to improve the design.
HTH,
Kevin
Kevin Viel, PhD
Post-doctoral fellow
Department of Genetics
Southwest Foundation for Biomedical Research
San Antonio, TX 78227
|