LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 20 May 2000 10:42:15 -0400
Reply-To:     Jeremy Miller <millerj@calib.com>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jeremy Miller <miller.jt@HOME.NET>
Subject:      Re: WHERE statement and zeros
Comments: cc: mjudas@gwdg.de
Content-Type: text/plain; charset="iso-8859-1"

Hi Michael,

This isn't a logical flaw with SAS. What you are seeing is normal. The name of a numeric value can stand alone because SAS interprets values of missing and zero as "false," and other values as "true." This also is the case with string values because SAS will return values that are not blank.

A place you see this a lot is in merge statements:

data new; merge one (IN=a) two (IN=b); by id; if a; run;

The IN=a sets up a temporary variable which is either true or false, depending on whether or not the observation came from the "one" data set. The statement "if a;" selects only those observations that are true (a=1 as opposed to a=0) resulting in only observations from data set one along with any merged information from two.

HTH

Jeremy

----- Original Message ----- From: Michael Judas <mjudas@gwdg.de> Newsgroups: comp.soft-sys.sas Sent: Saturday, May 20, 2000 10:23 AM 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