|
On Fri, 1 Dec 2006 21:34:31 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:
>Andrea ,
>
>That is why I gave both.
Now, how about special missing values? The MISSING function will detect those.
>
>
>
>Toby Dunn
>
>Quickly, bring me a beaker of wine, so that I may wet my mind and say
>something clever.
>Aristophanes
>
>Wise people, even though all laws were abolished, would still lead the same
>life.
>Aristophanes
>
>You should not decide until you have heard what both have to say.
>Aristophanes
>
>
>
>
>
>
>From: "Wainwright, Andrea" <andrea.wainwright@CAPITALONE.COM>
>Reply-To: "Wainwright, Andrea" <andrea.wainwright@CAPITALONE.COM>
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: Evaluating an IF/THEN in the negative?
>Date: Fri, 1 Dec 2006 14:38:59 -0500
>
>Not to nitpick, but might you want to do the division if VAR1 is a
>negative number? If so the second option would fail.
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>toby dunn
>Sent: Friday, December 01, 2006 10:39 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: Evaluating an IF/THEN in the negative?
>
>Paula ,
>
>I see you have gotten plenty of solutions so far, confused as all get
>out yet????
>
>Okay let me make this as simple as possible the code you are using just
>needs to be made simplier, remember simplier ussually means better.
>
>If your goal is to prevent the division when Var1 is either 0 or missing
>then,
>
>If ( VAR1 Not In ( . 0 ) ) Then Result1 = ABC / VAR1 ;
>Else Result1 = 999999999999999 ;
>
>Or
>
>If ( VAR1 > 0 ) ) Then Result1 = ABC / VAR1 ;
>Else Result1 = 999999999999999 ;
>
>
>
>Toby Dunn
>
>Quickly, bring me a beaker of wine, so that I may wet my mind and say
>something clever.
>Aristophanes
>
>Wise people, even though all laws were abolished, would still lead the
>same life.
>Aristophanes
>
>You should not decide until you have heard what both have to say.
>Aristophanes
>
>
>
>
>
>
>From: Paula Sims <paulasims2004@HOTMAIL.COM>
>Reply-To: Paula Sims <paulasims2004@HOTMAIL.COM>
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Evaluating an IF/THEN in the negative?
>Date: Fri, 1 Dec 2006 03:34:35 GMT
>
>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
>
>_________________________________________________________________
>MSN Shopping has everything on your holiday list. Get expert picks by
>style, age, and price. Try it!
>http://shopping.msn.com/content/shp/?ctId=8000,ptnrid=176,ptnrdata=20060
>1&tcode=wlmtagline
>
>
>
>The information contained in this e-mail is confidential and/or proprietary
>to Capital One and/or its affiliates. The information transmitted herewith
>is intended only for use by the individual or entity to which it is
>addressed. If the reader of this message is not the intended recipient,
>you are hereby notified that any review, retransmission, dissemination,
>distribution, copying or other use of, or taking of any action in reliance
>upon this information is strictly prohibited. If you have received this
>communication in error, please contact the sender and delete the material
>from your computer.
>
>_________________________________________________________________
>MSN Shopping has everything on your holiday list. Get expert picks by style,
>age, and price. Try it!
>http://shopping.msn.com/content/shp/?ctId=8000,ptnrid=176,ptnrdata=200601&tcode=wlmtagline
|