<?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 Question on %IF   not = in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137076#M27721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to execute the following code.&amp;nbsp; It works fine when I change the&amp;nbsp; "not ="&amp;nbsp;&amp;nbsp; to&amp;nbsp; an "='"&amp;nbsp; Sign.&amp;nbsp; But I do not understand why not = is not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO&amp;nbsp; Combine_and_Transpose(REG);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %eval( "&amp;amp;Reg."&amp;nbsp; not = "ALL")&amp;nbsp; %then &lt;/P&gt;&lt;P&gt;&amp;nbsp; %let Group_vars = %STR(ACCOUNT_NAME);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %Else %let Group_vars = %STR(REGION PU9 GROUP_NAME ACCOUNT_NAME INSUTYPE);&lt;/P&gt;&lt;P&gt;%Mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Combine_and_Transpose(&amp;amp;REG.);&lt;/P&gt;&lt;P&gt;Run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Message - &lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MAS"&amp;nbsp; not = "ALL" &lt;/P&gt;&lt;P&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;/P&gt;&lt;P&gt;ERROR: The macro COMBINE_AND_TRANSPOSE will stop executing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Mar 2014 18:55:05 GMT</pubDate>
    <dc:creator>Smijoss</dc:creator>
    <dc:date>2014-03-07T18:55:05Z</dc:date>
    <item>
      <title>Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137076#M27721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to execute the following code.&amp;nbsp; It works fine when I change the&amp;nbsp; "not ="&amp;nbsp;&amp;nbsp; to&amp;nbsp; an "='"&amp;nbsp; Sign.&amp;nbsp; But I do not understand why not = is not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO&amp;nbsp; Combine_and_Transpose(REG);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %eval( "&amp;amp;Reg."&amp;nbsp; not = "ALL")&amp;nbsp; %then &lt;/P&gt;&lt;P&gt;&amp;nbsp; %let Group_vars = %STR(ACCOUNT_NAME);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %Else %let Group_vars = %STR(REGION PU9 GROUP_NAME ACCOUNT_NAME INSUTYPE);&lt;/P&gt;&lt;P&gt;%Mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Combine_and_Transpose(&amp;amp;REG.);&lt;/P&gt;&lt;P&gt;Run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Message - &lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MAS"&amp;nbsp; not = "ALL" &lt;/P&gt;&lt;P&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;/P&gt;&lt;P&gt;ERROR: The macro COMBINE_AND_TRANSPOSE will stop executing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 18:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137076#M27721</guid>
      <dc:creator>Smijoss</dc:creator>
      <dc:date>2014-03-07T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137077#M27722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using "ne".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 19:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137077#M27722</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2014-03-07T19:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137078#M27723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Not Equals is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;^=&amp;nbsp; &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>Fri, 07 Mar 2014 19:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137078#M27723</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-07T19:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137079#M27724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot ...&amp;nbsp;&amp;nbsp; i like the NE&amp;nbsp; compared to&amp;nbsp; ^=&amp;nbsp;&amp;nbsp; :smileygrin:&amp;nbsp; but both shud work i believe. ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish sas had used the &amp;lt;&amp;gt; symbol &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 19:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137079#M27724</guid>
      <dc:creator>Smijoss</dc:creator>
      <dc:date>2014-03-07T19:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137080#M27725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS does use the &amp;lt;&amp;gt; operator but it is NOT the same as the NE operator.&amp;nbsp; &lt;/P&gt;&lt;P&gt;In base SAS and IML it means take the maximum value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So result of 0 &amp;lt;&amp;gt; -3 is 0 .&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>Fri, 07 Mar 2014 23:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137080#M27725</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-07T23:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question on %IF   not =</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137081#M27726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just put the NOT outside the comparison. Also %EVAL() is not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; %if %eval( "&amp;amp;Reg."&amp;nbsp; not = "ALL")&amp;nbsp; %then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;use &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; %if not ( "&amp;amp;Reg."&amp;nbsp; = "ALL")&amp;nbsp; %then&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 23:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-on-IF-not/m-p/137081#M27726</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-07T23:34:33Z</dc:date>
    </item>
  </channel>
</rss>

