<?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: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper 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/591999#M169693</link>
    <description>&lt;P&gt;Adding to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;'s recommendations for macro quoting papers:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://analytics.ncsu.edu/sesug/2008/CS-049.pdf" target="_blank"&gt;https://analytics.ncsu.edu/sesug/2008/CS-049.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All four are excellent papers, worth reading at least once a year. : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 19:49:43 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2019-09-26T19:49:43Z</dc:date>
    <item>
      <title>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591988#M169688</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let ab= \\trg\mt-4tsr\stud\err\pgm\out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro tr(ds=);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; %if &amp;amp;ds. = &amp;amp;ab %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; data afg;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; set sashelp.cars;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%tr(ds=&amp;amp;ab);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am getting error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric&lt;BR /&gt;operand is required. The condition was: &amp;amp;ds.=&amp;amp;ab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591988#M169688</guid>
      <dc:creator>sam1231</dc:creator>
      <dc:date>2019-09-26T19:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591993#M169690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243302"&gt;@sam1231&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) there is semicolon missing in the %let statement&lt;/P&gt;&lt;P&gt;2) there is %end; missing in the macro code&lt;/P&gt;&lt;P&gt;3) make it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%bquote(&amp;amp;ds.) = %bquote(&amp;amp;ab)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;4) read this article:&amp;nbsp;&lt;A href="https://stats.idre.ucla.edu/wp-content/uploads/2016/02/bt185.pdf" target="_blank"&gt;https://stats.idre.ucla.edu/wp-content/uploads/2016/02/bt185.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;5) and this article:&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings09/022-2009.pdf" target="_blank" rel="nofollow noopener noreferrer"&gt;https://support.sas.com/resources/papers/proceedings09/022-2009.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591993#M169690</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-26T19:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591995#M169692</link>
      <description>&lt;P&gt;You might want to try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %bquote(&amp;amp;ds) = %bquote(&amp;amp;ab) %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that's not it, please turn on the debugging options as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint mlogic symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;run the code again, and show us the entire LOG file (not just the error messages) by clicking on the {i} icon and pasting the log into the window that appears.&amp;nbsp;&lt;STRONG&gt;Do not skip this step.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591995#M169692</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-26T19:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591999#M169693</link>
      <description>&lt;P&gt;Adding to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;'s recommendations for macro quoting papers:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://analytics.ncsu.edu/sesug/2008/CS-049.pdf" target="_blank"&gt;https://analytics.ncsu.edu/sesug/2008/CS-049.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All four are excellent papers, worth reading at least once a year. : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/591999#M169693</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-09-26T19:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/592000#M169694</link>
      <description>&lt;P&gt;%BQUOTE should solve this.&amp;nbsp; Another easy way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if "&amp;amp;ds." = "&amp;amp;ab" %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The basic problem is that macro language sees the "-" in the middle of the string and decides that it needs to subtract.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The use of double quotes suppresses that interpretation of the "-" although it introduces complications if one or both strings contain leading or trailing blanks.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/592000#M169694</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-09-26T19:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/592012#M169697</link>
      <description>&lt;P&gt;Fix the obvious ERRORs (missing semicolon and %end), and use quotes for the strings:&lt;/P&gt;
&lt;PRE&gt;73         %let ab= \\trg\mt-4tsr\stud\err\pgm\out;
 74         
 75         %macro tr(ds=);
 76         %if "&amp;amp;ds." = "&amp;amp;ab" %then %do;
 77         data afg;
 78         set sashelp.cars;
 79         run;
 80         %end;
 81         %mend;
 82         
 83         %tr(ds=&amp;amp;ab);
 
 NOTE: There were 428 observations read from the data set SASHELP.CARS.
 NOTE: The data set WORK.AFG has 428 observations and 15 variables.
&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Sep 2019 20:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/592012#M169697</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-26T20:16:28Z</dc:date>
    </item>
  </channel>
</rss>

