=========================================================================
Date: Thu, 18 Jul 2002 16:16:32 -0400
Reply-To: "Huang, Ya" <ya.huang@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@PFIZER.COM>
Subject: Re: Division by Zero/Missing Value Errors
Content-Type: text/plain
One way to achieve is to use SQL:
data xx;
input x y;
cards;
1 2
3 4
4 0
5 7
;
proc sql;
select *, x/y as z
from xx
;
data xx;
set xx;
z=x/y;
run;
----------------
21 ;
22
23 proc sql;
24 select *, x/y as z
25 from xx
26 ;
27
NOTE: PROCEDURE SQL used:
real time 0.00 seconds
cpu time 0.00 seconds
28 data xx;
29 set xx;
30 z=x/y;
31 run;
NOTE: Division by zero detected at line 30 column 5.
x=4 y=0 z=. _ERROR_=1 _N_=3
NOTE: Mathematical operations coul
Note that SQL part do not give NOTE(error).
Whether this is good or not, I don't know. Some people
prefer to get some kind of warning....
Kind regards,
Ya Huang
-----Original Message-----
From: Jim [mailto:jlinck@UGA.EDU.NOSPAM]
Sent: Thursday, July 18, 2002 11:05 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Division by Zero/Missing Value Errors
I often have a great deal of division by missing value/zero errors in my SAS
log. Since I often search my log for the word "error" while I am debugging
programs, this is a pain. What I end up doing is writing lots of if
statements (if denominator=0, then don't do the calc), etc. I was wondering
if there is an option to turn of this specific type of error from reporting
within SAS. Thanks,