<?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 ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146929#M262102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me where I am going wrong with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %let __tmpmv_dsid = %sysfunc(open(__tmpds_param_check));&lt;/P&gt;&lt;P&gt; %let __tmpmv_num = %sysfunc(varnum(&amp;amp;__tmpmv_dsid,si_unit));&lt;/P&gt;&lt;P&gt; %let __tmpmv_rc&amp;nbsp; = %sysfunc(fetchobs(&amp;amp;__tmpmv_dsid,1));&lt;/P&gt;&lt;P&gt; %let __tmpmv_val = %sysfunc(getvarc(&amp;amp;__tmpmv_dsid,&amp;amp;__tmpmv_num));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt; %if not &amp;amp;__tmpmv_val&amp;nbsp; %then %do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %str (W)ARNING: SI Unit is not available for parameter: %nrbquote(&amp;amp;param) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %str (W)ARNING: Raw unit will be used for CTCAE grade computation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let errcode = %eval(&amp;amp;errcode + 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let __tmpmv_dsid = %sysfunc(close(&amp;amp;__tmpmv_dsid));&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %let __tmpmv_dsid = %sysfunc(close(&amp;amp;__tmpmv_dsid));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: not &amp;amp;__tmpmv_val&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 19:23:37 GMT</pubDate>
    <dc:creator>kingCobra</dc:creator>
    <dc:date>2014-12-11T19:23:37Z</dc:date>
    <item>
      <title>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146929#M262102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me where I am going wrong with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %let __tmpmv_dsid = %sysfunc(open(__tmpds_param_check));&lt;/P&gt;&lt;P&gt; %let __tmpmv_num = %sysfunc(varnum(&amp;amp;__tmpmv_dsid,si_unit));&lt;/P&gt;&lt;P&gt; %let __tmpmv_rc&amp;nbsp; = %sysfunc(fetchobs(&amp;amp;__tmpmv_dsid,1));&lt;/P&gt;&lt;P&gt; %let __tmpmv_val = %sysfunc(getvarc(&amp;amp;__tmpmv_dsid,&amp;amp;__tmpmv_num));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt; %if not &amp;amp;__tmpmv_val&amp;nbsp; %then %do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %str (W)ARNING: SI Unit is not available for parameter: %nrbquote(&amp;amp;param) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %str (W)ARNING: Raw unit will be used for CTCAE grade computation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let errcode = %eval(&amp;amp;errcode + 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let __tmpmv_dsid = %sysfunc(close(&amp;amp;__tmpmv_dsid));&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %let __tmpmv_dsid = %sysfunc(close(&amp;amp;__tmpmv_dsid));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: not &amp;amp;__tmpmv_val&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 19:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146929#M262102</guid>
      <dc:creator>kingCobra</dc:creator>
      <dc:date>2014-12-11T19:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146930#M262103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the value of &amp;amp;__tmpm_val?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;gt;&amp;gt;&amp;amp;__tmpmv_val.&amp;lt;&amp;lt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the message (and your code), since you are using GETVARC, it could a character value.&amp;nbsp; The %IF statement is written as if it expects a Boolean value (0/1), or at least an integer that the macro language could treat as a Boolean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;28&amp;nbsp;&amp;nbsp; %macro Check(p);
29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if not &amp;amp;p %then %put true;
30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else %put false;
31&amp;nbsp;&amp;nbsp; %mend;
32
33&amp;nbsp;&amp;nbsp; %check(1)
false
34&amp;nbsp;&amp;nbsp; %check(0)
true
35&amp;nbsp;&amp;nbsp; %check(9)
false
36&amp;nbsp;&amp;nbsp; %check(A)&amp;nbsp;&amp;nbsp; /*Error*/
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; operand is required. The condition was: not &amp;amp;p
ERROR: The macro CHECK will stop executing.
37&amp;nbsp;&amp;nbsp; %check(1.)&amp;nbsp; /*Error: %eval doesnt know about decimals*/
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; operand is required. The condition was: not &amp;amp;p
ERROR: The macro CHECK will stop executing.

&lt;/PRE&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 19:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146930#M262103</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-12-11T19:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146931#M262104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Quentin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, for your answer. My &amp;amp;__tmpmv_val is either blank (" ") or a char value (d/L, mg/dL etc).&lt;/P&gt;&lt;P&gt;What is the way out in these cases? Any alternative idea would be great too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 20:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146931#M262104</guid>
      <dc:creator>kingCobra</dc:creator>
      <dc:date>2014-12-11T20:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146932#M262105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;You can check for most BLANK conditions with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;%sysevalf&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;%superq&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;(macrovariablename)=,boolean)=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: SAS Monospace;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;%do&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;NOTE: the macrovariable name should not use the &amp;amp;macrovariablename format. Look at the documentation of %superq.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 21:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146932#M262105</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-12-11T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146933#M262106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While there is some debate on the best way, this is the way I prefer to check for blank vs. non-blank:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %length(&amp;amp;__tmpmv_val)=0 %then %do;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can actually find an entire paper devoted to this subject.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 21:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146933#M262106</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-12-11T21:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146934#M262107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;%if&amp;nbsp; &amp;amp;__tmpmv_val eq %then.........&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Dec 2014 06:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146934#M262107</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-14T06:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146935#M262108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/146935#M262108</guid>
      <dc:creator>kingCobra</dc:creator>
      <dc:date>2015-01-09T16:21:51Z</dc:date>
    </item>
  </channel>
</rss>

