<?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: Understanding of &amp;lt;&amp;gt; in If clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820003#M323636</link>
    <description>&lt;P&gt;In IF statements, &amp;lt;&amp;gt; is MAX&lt;/P&gt;
&lt;P&gt;In WHERE statements or WHERE clauses, &amp;lt;&amp;gt; is not equal to.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 13:38:11 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-06-23T13:38:11Z</dc:date>
    <item>
      <title>Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819965#M323627</link>
      <description>&lt;P&gt;What is the meaning of &amp;lt;&amp;gt; in the below? Is it not equals or max?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whether this symbol &amp;lt;&amp;gt; has different meaning in where clause and if clause?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.REQ3;
length PrimaryBOM $50;  
set work.REQS;
if BOMQTY &amp;lt;&amp;gt; . then
do;
PrimaryBOM=cat('. .', Component);
PRIMBOMCL=Component;
end;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2022 12:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819965#M323627</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2022-06-23T12:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819966#M323628</link>
      <description>&lt;P&gt;This log should be telling you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;45         data _null_;
46            x = 1 &amp;lt;&amp;gt; 2;
NOTE: The "&amp;lt;&amp;gt;" operator is interpreted as "MAX".
47            y = 1 max 2;
48            if 1 &amp;lt;&amp;gt; 2 then put '*';
NOTE: The "&amp;lt;&amp;gt;" operator is interpreted as "MAX".
49            put _all_;
50            run;

*
x=2 y=2 _ERROR_=0 _N_=1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2022 12:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819966#M323628</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-06-23T12:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819969#M323630</link>
      <description>&lt;P&gt;SAS operators are documented &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p1n8bsqqd03xppn17pgvjpjlbhhs.htm" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Never seen &amp;lt;&amp;gt; used this way meaning max.&amp;nbsp; ...and given its much more common meaning of &lt;EM&gt;Not equal to&lt;/EM&gt; in SQL I'd never use it in my code.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 12:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819969#M323630</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-06-23T12:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819970#M323631</link>
      <description>&lt;P&gt;&amp;lt;&amp;gt; is max as stated above, except that in a WHERE clause it means "not equal to"&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 12:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819970#M323631</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-23T12:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819974#M323632</link>
      <description>It would be treated as Max or not equal to in the posted code?&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2022 13:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/819974#M323632</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2022-06-23T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820003#M323636</link>
      <description>&lt;P&gt;In IF statements, &amp;lt;&amp;gt; is MAX&lt;/P&gt;
&lt;P&gt;In WHERE statements or WHERE clauses, &amp;lt;&amp;gt; is not equal to.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 13:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820003#M323636</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-23T13:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820071#M323661</link>
      <description>I just want to know the meaning of this line in if clause,&lt;BR /&gt;&lt;BR /&gt;if variable &amp;lt;&amp;gt; . then ....&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2022 16:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820071#M323661</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2022-06-23T16:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820075#M323664</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I just want to know the meaning of this line in if clause,&lt;BR /&gt;&lt;BR /&gt;if variable &amp;lt;&amp;gt; . then ....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the value that results from finding the maximum of the value of VARIABLE and a missing value is TRUE then execute ....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;A missing value is always less than any actual number.&amp;nbsp; So if VARIABLE is numeric then the expression&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(variable &amp;lt;&amp;gt; .)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Reduces to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(variable)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A number is TRUE if it is not zero and not missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you are running:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (not missing(variable)) and (variable ne 0) then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is different then just running&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (variable ne .) then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(which someone might have thought there were doing by using that strange &amp;lt;&amp;gt; symbol).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bottom line is &lt;STRONG&gt;never&lt;/STRONG&gt; use &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt; as an operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use something that is clearer to humans.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a ne b then ...
if not (a = b) then ...
if a = b then; else ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2022 17:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820075#M323664</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-23T17:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820076#M323665</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I just want to know the meaning of this line in if clause,&lt;BR /&gt;&lt;BR /&gt;if variable &amp;lt;&amp;gt; . then ....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The phrase &lt;FONT face="courier new,courier"&gt;variable &amp;lt;&amp;gt; .&lt;/FONT&gt; is a Boolean expression, it is either true or false. It is taking the maximum of the value of VARIABLE and a missing value, and if that maximum value is not equal to zero (which it probably isn't), then the Boolean value is true (that's how Booleans work, 0 is false and anything else is true) and the THEN clause executes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 17:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820076#M323665</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-23T17:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820103#M323668</link>
      <description>Number will be true when it is not equal to missing. In this case, &amp;lt;&amp;gt; means&lt;BR /&gt;still not equals although it should be read as MAX&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2022 17:27:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820103#M323668</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2022-06-23T17:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820108#M323670</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Number will be true when it is not equal to missing. In this case, &amp;lt;&amp;gt; means&lt;BR /&gt;still not equals although it should be read as MAX&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an IF statement &amp;lt;&amp;gt; means maximum, it does not mean "not equal to". Boolean expression will be true when the max is not [0 or missing]. Any other maximum value (such as 7 or –2.5) is true.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    do y=-3 to 3 by 1, . ;
        maximum_value = y&amp;lt;&amp;gt;.;
        if maximum_value then flag=1;
        else flag=0;
        if y&amp;lt;&amp;gt;. then another_flag=1;
        else another_flag=0;
        output;
    end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 17:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820108#M323670</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-23T17:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820110#M323671</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Number will be true when it is not equal to missing. In this case, &amp;lt;&amp;gt; means&lt;BR /&gt;still not equals although it should be read as MAX&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If VARIABLE is zero then it is larger than missing but it will be FALSE since zero is FALSE.&lt;/P&gt;
&lt;P&gt;So MAX(VARAIBLE,.) is not the same thing as (VARIABLE ne .).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 17:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820110#M323671</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-23T17:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820112#M323673</link>
      <description>&lt;P&gt;If that condition was meant to mean "bomqty is not missing", then you should use the "ne" mnemonic for the not equals operator.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 18:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820112#M323673</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-23T18:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of &lt;&gt; in If clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820113#M323674</link>
      <description>&lt;P&gt;Just do not use &amp;lt;&amp;gt; or &amp;gt;&amp;lt; as operators and you will avoid confusion.&lt;/P&gt;
&lt;P&gt;It is not at all obvious to me why anyone would think that &amp;lt;&amp;gt; is a useful way to express not equal or maximum for that matter.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://petesguide.com/symbols/elevator-button-symbols/" target="_self"&gt;Just like elevator door open/close buttons.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 18:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-lt-gt-in-If-clause/m-p/820113#M323674</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-23T18:09:55Z</dc:date>
    </item>
  </channel>
</rss>

