|
I would write a data steps or proc steps that test all macro
parameters, so you can stop before any significant processing has
taken place.
You can test for existence of variables and data sets with transpose,
plus you can expand SAS Variable Lists.
Simplistic example:
%macro mymac(var=,data=);
proc transpose data=&data(obs=0) out=varlist;
var &var;
run;
%put NOTE: SYSERR=&syserr;
%if &syserr %then %do;
%put %str(ERR)OR: You need to fix...;
%goto eexit;
%end;
%goto exit;
%eexit:
%PUT %str(ERR)OR: &sysmacroname ending with errors;
%exit:
%put NOTE: &sysmacroname ending execution.;
%mend;
%mymac(var=a b c,data=sashelp.class);
%mymac(var=name age,data=work.class);
Hours? Perhaps we(SAS-L) need to look at that.
On 3/26/09, joey m <sasuser.joey.m@gmail.com> wrote:
> Thanks a lot.
>
> I'll try to implement that to end my SAS job if rc=0 as soon as my macro
> reads the path...no hours after.
>
> Have a good day.
>
>
>
>
> On Thu, Mar 26, 2009 at 10:20 AM, joey m <sasuser.joey.m@gmail.com> wrote:
>
> > Hi:
> >
> > Would you please point out references, etc where I can learn how to stop a
> > SAS routine and get a message (i.e. in a DOS window) when a subdirectory
> > does not exist.
> >
> > Imagine a macro reads a file with parameters, including %let statements
> > defining a path (where a production report is going to be stored). Someone :
> > ) may have made a mistake while keying the path. I would not like to wait
> > until the whole process finishes (i.e. maybe running overnite) and see a
> > message in the log that the directory does not exist...(and neither my
> > file). Thanks in advance for the feedback.
> >
> > Kindest regards,
> >
> >
> >
> >
> >
>
|