Date: Mon, 18 Dec 2000 12:53:11 -0500
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: Division by missing (Zero).
On Mon, 18 Dec 2000 12:11:05 -0500, Howard Schreier
Little addon: if you really want the system to provide the error message
and produce the missing values, you should set the option ERRORS= to a high
value. After the number of errors SAS should ignore, normally an abend
I'd prefer to make it explicite, something like:
if div=. then do;
put "missing value for DIV...";
In this way you can deal with all kind of errors and the program always
>The normal behavior of SAS is precisely what is requested in the original
>When a divisor is missing, SAS skips the calculation, records a missing
>value for the result, and places a summary note in the log. It does not
>(at least not under usual system options settings).
>This is called propagation of missing values, and applies to expression
>evaluation in general (not just to division).
>Division by zero (which is not illustrated in the sample data) is
>different. It makes a bigger mess in the log, but it does not stop
>On Fri, 15 Dec 2000 17:09:03 -0800, kmself@IX.NETCOM.COM wrote:
>>on Fri, Dec 15, 2000 at 12:34:49PM -0800, Anna Henson
>>> Shiferaw_G wrote in message
>>> >I have a data set as follow:
>>> >Data T1;
>>> >Input C D E;
>>> >Av_CD= C/D;
>>> >When one of the variables is missing I get division by zero and the
>>> >process is stopped. I want the process to continue with calculating the
>>> >Average of those variables which values and skip or flag those with
>>> >values. Is it possible to do that with SAS?
>>> >1 3 4
>>> >3 . 4
>>> >. 5 .
>>> Hi This is what I got from SAS website for division by Zero
>>> Just replace x/y with x/(y+(y=0)) - x*(y=0)
>>> I tried it, and it worked great.
>>At least two problems:
>> 1. What is the intended result where no calculation is performed --
>> is it zero, missing, some other assigned value, or a special flag?
>> This logic doesn't provide for this.
>> 2. The logic doesn't allow for missing values. I believe a test for
>> ( abs( y ) gt 0 )
>> would be an improvement. SI's example site should correct this.
>>Note also: I prefer the lt, gt, and eq operators for platform
>>portability and lack of confusion with the SAS assignment operator '='.
>>Token overloading is a Bad Thing [tm], particularly for very frequently
>>used tokens whose alternative uses may be easily confused.
>>As they say in Humboldt County, "Don't overload your tokin', dude".
>>Karsten M. Self <firstname.lastname@example.org> http://kmself.home.netcom.com/
>> Evangelist, Zelerate, Inc. http://www.zelerate.org
>> What part of "Gestalt" don't you understand? There is no K5 cabal
>> http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org