Date: Fri, 22 Feb 2008 22:01:05 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: Re: Selectively suppressing error messages (WAS: Another way of
doing this?)
> Mike,
>
> I would prefer something more general along the lines of
>
> begin ;
> /* any code */
> rescue <error code list> ;
> /* handle error where one of the possibilities
> is suppress message or allow message,
> and another is to replace the offending code
> */
> end ;
>
> While this style works well in an object oriented programming
> environment, it might involve a great deal more thought to implement
> well in SAS, but as time passes, the lack of such thought to error
> handling becomes greater. I think the basic problem is that SAS has
> grown from a "user" language where error messages are almost always
> needed and expected to a "programmer" language where the system needs
> tools to say "trust the programmer".
>
> In the mean time, perhaps your suggestion could be easily implemented
> and worth while for the obnoxious little numeric problems. It might
> even be implemented with
>
> if missing ( <expression> ) then .... ;
> else ... ;
>
> where MISSING has the job of suppressing any error messages in
> evaluating the expression. It doesn't seem unreasonable to allow the
> programmer to check an expression, without getting the messages, the
> programmer does the checking to avoid.
>
> For the immediate problem, data _null_ gave a solution by using the
> fact that CATS suppresses conversion messages the option MISSING="0"
> is respected by in the conversion process. The general message,
> manipulate characters to avoid numeric messages, is one worth
> remembering for the times one is willing to pay the price, and wants
> it now.
>
> Ian Whitlock
> ==============
>
> Date: Fri, 22 Feb 2008 13:23:09 -0500
> Reply-To: Mike Rhoads
> Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
> From: Mike Rhoads <RHOADSM1@WESTAT.COM>
> Subject: Selectively suppressing error messages (WAS: Another
> way of doing this?)
> Comments: To: iw1junk@comcast.net
> In-Reply-To:
> <022220081727.8786.47BF06070005EB5700002252220076106405029A06CE9907@co
> mcast.net>
> Content-Type: text/plain; charset="us-ascii"
>
> How about a new function that would provide some control of this:
>
> NOERR(numericargument,modifiers)
>
> The expression in question would become the first argument of the
> function. The second would be a character string containing one or
> more single-character flags (similar to the enhanced COMPRESS
> function), which would indicate the type(s) of errors to be suppressed
> -- maybe M for missing values, Z for division by zero, etc.
>
> Mike Rhoads Westat RhoadsM1@Westat.com
>
> -----Original Message----- From: owner-sas-l [
> mailto:owner-sas-l] On Behalf Of iw1junk@comcast.net
> Sent: Friday, February 22, 2008 12:28 PM To: SAS(r) Discussion Cc:
> Franz Subject: Re: Another way of doing this?
>
> ...
>
> As for elegance in the above code you must suffer irrelevant missing
> value messages or NONOTES. On the other hand, one might say this is
> the inelegance of the system which does not give the programmer fine
> grain control of error messages, rather than inelegance of the
> program.
>
> Ian Whitlock
>
> ...
|