LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 26 Mar 2009 10:16:29 -0500
Reply-To:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: WI When directory does not exist
Comments:   To: joey m <sasuser.joey.m@gmail.com>
In-Reply-To:   <705bcd670903260752p48aa2e28s7423aab8f13a931b@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

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, > > > > > > > > > > >


Back to: Top of message | Previous page | Main SAS-L page