Date: Thu, 26 Mar 2009 11:29:40 -0400
Reply-To: joey m <sasuser.joey.m@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: joey m <sasuser.joey.m@GMAIL.COM>
Subject: Re: WI When directory does not exist
In-Reply-To: <ce1fb7450903260816y62e8548ck9fde9f1ffb107195@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Thanks.
Exactly, what I need is to stop everything before the process gets on its
way, then go back, make corrections and run again. I know there are some
options to create another subdirectory (if the original does not exist) and
have an output file that I can copy to the correct path after the process
finishes, but for now I will play with your recommendation, and see how I
can progress.
It takes hour for several reasons, my slow pc, slow network, my programming
style : (, and lots of data sets to read and process. For sure, should this
gets unsustainable, I will contact the group again.
As always, the feedback is really appreciated.
On Thu, Mar 26, 2009 at 11:16 AM, ./ ADD NAME=Data _null_; <
iebupdte@gmail.com> wrote:
> 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,
> > >
> > >
> > >
> > >
> > >
> >
>
|