LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 Dec 2006 03:34:35 GMT
Reply-To:     Paula Sims <paulasims2004@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Paula Sims <paulasims2004@HOTMAIL.COM>
Organization: SBC http://yahoo.sbc.com
Subject:      Evaluating an IF/THEN in the negative?
Comments: To: sas-l@uga.edu

Hi everyone, I came across an interesting "issue" last week and was wondering why it worked one way but not the other.

Here's a bit 'o the code:

IF (MISSING(VAR1) = 0 OR VAR1 NE 0) THEN RESULT1 = ABC/VAR1; ELSE RESULT1 = 999999999999999;

The evaluation worked correctly for the MISSING part but not for the VAR1 NE 0. However, I adjusted the code to

IF (MISSING(VAR1) OR VAR1 = 0) THEN RESULT1 = 999999999999999; ELSE RESULT1 = ABC/VAR1;

and everything thing worked wonderfully every time in both situations. Why???

Thanks

Paula


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