RESENT
----- Forwarded by Carol A Srna/MI/CMA on 03/02/2007 11:26 AM -----

Carol A Srna/MI/CMA
03/02/2007 10:51 AM

To
IBM Mainframe Discussion List <[email protected]>
cc

Subject
Re: SAS IF Statement with ANDs and ORs





Many thanks to all who responded, both ON/OFFline.
Larry K.
L. K.
Ed Finnell (I added the extra parens)

Jack Kelly - pointing out the reverse logics and A. DeMorgan("Imagine a 
person with a gift of ridicule [He might say] First that a negative 
quantity has no logarithm; secondly that a negative quantity has no square 
root; thirdly that the first non-existent is to the second as the 
circumference of a circle is to the diameter." ( A. DeMorgan) 

Larry Gray(and the ANDs have it).

Final snippet of working code:
IF (STATUS = 'M' AND VOLSER NE '.' AND DSN NE ' ' )
   AND (LOCATION NE 'OAM' AND LOCATION NE 'DLYT' 
   AND LOCATION NE 'WLYT' 
   AND LOCATION NE 'SHELF' 
   AND LOCATION NE 'RACK' 
   AND LOCATION NE 'LONG' 
   AND LOCATION NE: 'ATL'); 




Ed Finnell <[EMAIL PROTECTED]> 
Sent by: IBM Mainframe Discussion List <[email protected]>
03/02/2007 09:59 AM
Please respond to
IBM Mainframe Discussion List <[email protected]>


To
[email protected]
cc

Subject
Re: SAS IF Statement with ANDs and ORs






 
In a message dated 3/2/2007 8:35:48 A.M. Central Standard Time, 
[EMAIL PROTECTED] writes:

IF  (STATUS = 'M' AND VOLSER NE '.' AND DSN NE ' '
OR LOCATION NE  'OAM' OR LOCATION NE 'DYLT');



>>
 
Bad logic...
 
If A and B then do, Both must be TRUE.
If A or B then do, only one must be TRUE.
 
  IF (STATUS = 'M' and VOLSER NE '.' and DSN NE  '      '
       AND (LOCATION NE 'OAM' or LOCATION NE  'DYLT');




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to