Date: Mon, 22 May 2000 11:13:16 +0200 Jim Groeneveld "SAS(r) Discussion" Jim Groeneveld Re: WHERE statement and zeros To: "mjudas@gwdg.de" text/plain

Michael,

When processing the result of a condition, and in your case a variable contains (the outcome of) a condition you have to bear in mind that a condition may be true or false. Furthermore all numerical values, which are not missing and not 0 (zero) are regarded true, the rest is false. You can't use a character variable for such a purpose, you should apply a usual condition (charvar EQ ' ') in such a case. So you may state: IF 1 THEN ............... (condition is true) IF 0 THEN ............... (condition ia false) IF . THEN ................ (condition is false) IF NOT 1 THEN ........ (condition is false) IF NOT 0 THEN ........ (condition is true) IF NOT 5 THEN ........ (condition is false) IF -4 THEN .............. (condition is true)

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statistician, P.O. Box 1 fax. +31 412 407 080 head IT department 5350 AA BERGHEM IMRO TRAMARKO: a CRO J.Groeneveld@ITGroups.com the Netherlands in clinical research

It is my job to keep my computer at work, but its job is to reveal my work.

> -----Original Message----- > From: Michael Judas [SMTP:mjudas@GWDG.DE] > Sent: Saturday, May 20, 2000 4:24 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: WHERE statement and zeros > > 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 > -----------------------------------------------------

Back to: Top of message | Previous page | Main SAS-L page