<?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/259301#M50150</link>
    <description>Macro variables don't have a type. They are always text. I suggest you check the values by adding a statement like %put &amp;gt;&amp;gt;&amp;amp;MonthF&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;MonthQ&amp;lt;&amp;lt;; to see what they resolve to. Or you could turn on options symbolgen.</description>
    <pubDate>Mon, 28 Mar 2016 02:27:10 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2016-03-28T02:27:10Z</dc:date>
    <item>
      <title>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259293#M50144</link>
      <description>&lt;P&gt;Using SAS EG 7.1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is only part of my macro, but it is where the problem occurs. How do I solve it? THank you&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 operand is required. The condition was:&lt;/P&gt;
&lt;P&gt;&amp;amp;MONTHF =12 and &amp;amp;MONTHQ=06&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Code]&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;MONTHF =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; and &amp;amp;MONTHQ =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;06&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%THEN&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%DO&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; YEAR=&amp;amp;FIRSTYR &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%TO&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%eval&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;LASTYR-&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; YEARQ = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%eval&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;YEAR); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; data Merged&amp;amp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;YEAR.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;MONTHF;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;merge&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; F&amp;amp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;YEAR.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;MONTHF (IN=A) QC&amp;amp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;YEARQ.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;MONTHQ(IN=B);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;BY UIN;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; IF A AND B Or (A AND Age=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;[/Code]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 01:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259293#M50144</guid>
      <dc:creator>apple</dc:creator>
      <dc:date>2016-03-28T01:00:59Z</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/259298#M50147</link>
      <description>&lt;P&gt;Are &amp;amp;MonthF and &amp;amp;MonthQ resolving?&amp;nbsp; What do they resolve to?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 02:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259298#M50147</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-03-28T02:02:00Z</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/259299#M50148</link>
      <description>&amp;amp;MonthF and &amp;amp;MonthQ are character type. They could be 06 or 12.</description>
      <pubDate>Mon, 28 Mar 2016 02:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259299#M50148</guid>
      <dc:creator>apple</dc:creator>
      <dc:date>2016-03-28T02:09:14Z</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/259301#M50150</link>
      <description>Macro variables don't have a type. They are always text. I suggest you check the values by adding a statement like %put &amp;gt;&amp;gt;&amp;amp;MonthF&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;MonthQ&amp;lt;&amp;lt;; to see what they resolve to. Or you could turn on options symbolgen.</description>
      <pubDate>Mon, 28 Mar 2016 02:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259301#M50150</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-03-28T02:27:10Z</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/259308#M50157</link>
      <description>&lt;P&gt;Your macro variables Year and YearQ are identical - I would recommend keeping only one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would consider simplifying your macro's. Write a single macro that stacks or merges your datasets the way you want. Create a dataset that has the list of datasets to merge and then use call execute to execute your macro. It will be easier to debug and modify in my opinion. Obviously this is a style choice, but I find macro loops to be unwieldy at the best of times.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm also wondering about your process...did you create all these separate monthly files, and is there a way to avoid that in the first place. This is usually why the recommendation comes to not split our data sets!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 03:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/259308#M50157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-28T03:53:10Z</dc:date>
    </item>
  </channel>
</rss>

