Date: Tue, 23 May 2000 09:14:49 EDT
Reply-To: Bernard Tremblay <imaginasys@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bernard Tremblay <imaginasys@HOTMAIL.COM>
Subject: Re: WHERE statement and zeros
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Hi Michael,
Think of missing values as an infinite negative number. Then you could
state the where clause as:
where var1 is missing or var1 >= 0 ;
There is many other way to rephrase the where clause, but I like this one
because it's clear.
consider also :
where var1 in(.,0) or var1>0;
where var1 in(.,abs(var1));
where not (var1 < 0) or var1 =. ;
where min(var1,0) >= 0 ;
ect.
Regards,
\\\|///
\\ - - //
( @ @ )
+-----oOOo-(_)-oOOo--+-----------------------------------+
| Bernard Tremblay | |
| CSST | Tel: (418) 528-9313 |
| | Fax: (418) 528-1493 |
| | Int: Bernard.Tremblay@csst.qc.ca |
+----------------------------+---------------------------+
| Imaginasys enr | Res: (418) 658-1411 |
| | Int: bertrem@quebectel.com |
| | Hot: imaginasys@hotmail.com |
+--------------Oooo--+-----------------------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>From: Michael Judas <mjudas@GWDG.DE>
>Reply-To: mjudas@gwdg.de
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: WHERE statement and zeros
>Date: Sat, 20 May 2000 14:24:18 +1
>
>Problem: numeric '0' treated as missing in where-statement
>Version: 6.12 TS 0060 / NT 4.0
>
>Dear SAS-Lers,
>
>I encountered the following problem:
>
>I want to process a dataset with a numeric variable var1 that has
>values missing (.), zero (0), and (positive) non-zero. If I use the
>statement
>
>... where var1 ; ...
>
>then only the non-missing & non-zero values are processed. If I
>use
>
>... where var1^=. ; ...
>or
>... where var1>=0 ; ...
>
>then all non-missing values (including zeros) are processed (as
>intended).
>
>My question is:
>Is this treatment of '0' just like '.' in the first syntax anywhere
>documented? (I found no hints in the abridged reference manual,
>the online help, or in a search at the SAS WWW-site.) Or is this
>behaviour governed by some (system-) option that I am not aware
>of? Or just a logical flaw in SAS?
>
>Michael
>
>-----------------------------------------------------
>Dr Michael Judas
>Institut f. Zoologie u. Anthropologie, Abt. Oekologie
>Berliner Str. 28, D-37073 Goettingen, Germany
>-----------------------------------------------------
>Tel +(49)551 395452 / Fax +(49)551 395448
>http://www.gwdg.de/~mjudas
>-----------------------------------------------------
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
|