<?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: Help with filtering logic... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789195#M252499</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;In order for A to stay, it needs to be greater than &lt;STRONG&gt;either&lt;/STRONG&gt; B or C.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Must be translated to the logic expression A &amp;gt; B or A &amp;gt; C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If A is less than BOTH B and C&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Means: A &amp;lt; B and A &amp;lt; C&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next step: what should happen if A = B and A = C?&lt;/P&gt;
&lt;P&gt;And: why should A be set to missing if it should "stay"?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jan 2022 07:44:55 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-01-10T07:44:55Z</dc:date>
    <item>
      <title>Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789186#M252491</link>
      <description>&lt;P&gt;Given A, B, C&lt;/P&gt;
&lt;P&gt;In order for A to stay, it needs to be greater than &lt;STRONG&gt;either&lt;/STRONG&gt; B or C.&lt;/P&gt;
&lt;P&gt;If A is less than BOTH B and C, it gets tossed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS-speak, the following doesn't appear to be correct.&amp;nbsp; Can someone please offer guidance?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#800000"&gt;if A &amp;lt; (B and C) then A = . ;
&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using 'or' doesn't seem to work either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, and, these are numeric variables, numbers....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey, it's been a long day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 06:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789186#M252491</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2022-01-10T06:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789187#M252492</link>
      <description>&lt;P&gt;I haven't tried this code, but it something like that...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If A &amp;lt; B or A &amp;lt; C then A = .;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If A gt B or A gt C then A = .;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those variables are numerical? What kind of values do you have on each column? May you will have some problem when calculating the values.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 04:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789187#M252492</guid>
      <dc:creator>KaueMAlmeida</dc:creator>
      <dc:date>2022-01-10T04:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789195#M252499</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;In order for A to stay, it needs to be greater than &lt;STRONG&gt;either&lt;/STRONG&gt; B or C.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Must be translated to the logic expression A &amp;gt; B or A &amp;gt; C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If A is less than BOTH B and C&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Means: A &amp;lt; B and A &amp;lt; C&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next step: what should happen if A = B and A = C?&lt;/P&gt;
&lt;P&gt;And: why should A be set to missing if it should "stay"?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 07:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789195#M252499</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-01-10T07:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789217#M252506</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a &amp;gt; min(b,c);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jan 2022 10:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789217#M252506</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-10T10:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789289#M252545</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22691"&gt;@NKormanik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Given A, B, C&lt;/P&gt;
&lt;P&gt;In order for A to stay, it needs to be greater than &lt;STRONG&gt;either&lt;/STRONG&gt; B or C.&lt;/P&gt;
&lt;P&gt;If A is less than BOTH B and C, it gets tossed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS-speak, the following doesn't appear to be correct.&amp;nbsp; Can someone please offer guidance?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#800000"&gt;if A &amp;lt; (B and C) then A = . ;
&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using 'or' doesn't seem to work either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, and, these are numeric variables, numbers....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey, it's been a long day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is "correct" in the way that SAS works. When you place a comparison in () such as (B and C) it evaluates that expression. Then returns the result of that expression as 1 (for true) or 0 for false. The comparison (B and C), since you use a Logic expression is testing "is B true and is C true". Which returns 1 when both are "true" or 0 if any are not "true". Values of 0 or missing are not "true".&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data example;
   input b c;
   result = (b and c);
datalines;
1 1
0 1
. 1
. .
2 3
-4 5
6 7
1000000 .000004
;&lt;/PRE&gt;
&lt;P&gt;So your code was asking, essentially, is "A &amp;lt;0" or is "A&amp;lt;1" depending on the values of B and C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789289#M252545</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-10T16:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filtering logic...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789572#M252665</link>
      <description>&lt;P&gt;Terrific,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;.&amp;nbsp; How easy that was.&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shows the great usefulness of max(), min().&amp;nbsp; And also, not().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 19:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-filtering-logic/m-p/789572#M252665</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2022-01-11T19:40:58Z</dc:date>
    </item>
  </channel>
</rss>

