<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AND OR NOT expressions  logical way of writing correction please? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193886#M305045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am just trying to learn and understand by asking how the condition is checked with and without parentheses and how the results differ. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 18:59:21 GMT</pubDate>
    <dc:creator>Andygray</dc:creator>
    <dc:date>2015-07-01T18:59:21Z</dc:date>
    <item>
      <title>AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193884#M305043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I would like to know what is the correct way to write or in other words use AND OR NOT operators in SAS?&lt;/P&gt;&lt;P&gt;Let's us suppose we have 3 variables with names A B C in a dataset&lt;/P&gt;&lt;P&gt;/*which way of syntax is correct*?*/&lt;/P&gt;&lt;P&gt;if missing(a) or missing(b) and missing(c) then.....&amp;nbsp; is this correct? or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;STRONG&gt; (missing(a) or missing(b))&lt;/STRONG&gt; and missing(c) then......is is correct, meaning with the parenthesis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another condition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if missing(a) and missing(b) and missing(c) then......is this correct? or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &lt;STRONG&gt;(missing(a) and missing(b))&lt;/STRONG&gt; and missing(c) then...is is correct, meaning with the parenthesis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please clarify the need for &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;parenthesis&lt;/STRONG&gt;&lt;/SPAN&gt;. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 18:40:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193884#M305043</guid>
      <dc:creator>Andygray</dc:creator>
      <dc:date>2015-07-01T18:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193885#M305044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to define CORRECT.&amp;nbsp; &lt;/P&gt;&lt;P&gt;All will work but may generate different results so it depends on what you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 18:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193885#M305044</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-01T18:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193886#M305045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am just trying to learn and understand by asking how the condition is checked with and without parentheses and how the results differ. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 18:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193886#M305045</guid>
      <dc:creator>Andygray</dc:creator>
      <dc:date>2015-07-01T18:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193887#M305046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it and see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let tests=&lt;/P&gt;&lt;P&gt; a and b or c&lt;/P&gt;&lt;P&gt;|(a and b) or c&lt;/P&gt;&lt;P&gt;|a and (b or c)&lt;/P&gt;&lt;P&gt;|a or b and c&lt;/P&gt;&lt;P&gt;|(a or b) and c&lt;/P&gt;&lt;P&gt;|a or (b and c)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;%macro xx ;&lt;/P&gt;&lt;P&gt;data xx;&lt;/P&gt;&lt;P&gt; do a=0,1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do b=0,1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do c=0,1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put (a b c) (=);&lt;/P&gt;&lt;P&gt;%do i=1 %to %sysfunc(countw(&amp;amp;tests,|));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testn=&amp;amp;i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test= "%scan(&amp;amp;tests,&amp;amp;i,|)";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val= %scan(&amp;amp;tests,&amp;amp;i,|);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put (testn test val) (=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end; end; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend xx;&lt;/P&gt;&lt;P&gt;%xx;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 19:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193887#M305046</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-01T19:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193888#M305047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful. That clears all my doubts in my brain. Thanks Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 19:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193888#M305047</guid>
      <dc:creator>Andygray</dc:creator>
      <dc:date>2015-07-01T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193889#M305048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is also documentation on the Order of Operations in Compound Expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm"&gt;SAS(R) 9.2 Language Reference: Concepts, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 19:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193889#M305048</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-01T19:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: AND OR NOT expressions  logical way of writing correction please?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193890#M305049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally, I make it a habit to use parentheses to clarify the order that I want for the evaluation, even if it matches the order without parentheses. This is for two reasons; first, different languages use different rules, and it's easy to make a mistake, and second, when someone else is looking at the code, they may not know the correct rules, and may mistake what the code is doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, I don't see any downside to using extra parentheses to make is explicitly clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 21:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AND-OR-NOT-expressions-logical-way-of-writing-correction-please/m-p/193890#M305049</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2015-07-01T21:08:21Z</dc:date>
    </item>
  </channel>
</rss>

