Date: Thu, 27 Jan 2005 14:52:31 +1100
Reply-To: Scott <usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott <usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU>
Subject: Re: How to check if a format exists?
Well, I did think of this:
proc format;
value xxx
1="A"
;
run;
%put %sysfunc(cexist(work.formats.xxx.format));
%put %sysfunc(cexist(work.formats.yyy.format));
Not as clean as the format function below, but may work. Let me know if you
have any better ideas.
Thanks,
Scott
"Scott" <usenet739_yahoo_com_au> wrote in message
news:41f84cbd$0$25515$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> Hi,
>
> I'd like to add some error trapping to a macro, trapping for the
> (non)existence of a format and gracefully exit rather than having it fall
> over in a heap.
>
> What I want is the SCL function rc=format('formatname.','c'), but in open
> code or a data _null_ step. format doesn't appear to be one of the
> functions that were made available to the data step or %sysfunc in v8.x.
>
> Any ideas?
>
> Thanks,
> Scott
>
|