<?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: Should %eval evaluate the FIND function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555495#M154589</link>
    <description>&lt;P&gt;%EVAL() is for integer calculations primarily or condition checks. For functions you want %SYSFUNC() which you need to wrap around each SAS function to differentiate it from text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use %SYSEVALF() to do decimal math.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/47540"&gt;@saras&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the following code (simplified from my original problem) I get the following error message :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: Required operator not found in expression: find("apple", "a")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: The macro TEST will stop executing.&lt;/P&gt;
&lt;P&gt;Is there any reason I cannot use the %eval on the find function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; %macro test();&lt;BR /&gt;%let a=apple;&lt;BR /&gt;%let b=a;&lt;BR /&gt;%let c=%eval(find("&amp;amp;a", "&amp;amp;b"));&lt;BR /&gt;%put &amp;amp;c;&lt;BR /&gt;%mend test;&lt;BR /&gt;%test();&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 21:57:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-05-01T21:57:49Z</dc:date>
    <item>
      <title>Should %eval evaluate the FIND function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555494#M154588</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the following code (simplified from my original problem) I get the following error message :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: Required operator not found in expression: find("apple", "a")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: The macro TEST will stop executing.&lt;/P&gt;
&lt;P&gt;Is there any reason I cannot use the %eval on the find function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; %macro test();&lt;BR /&gt;%let a=apple;&lt;BR /&gt;%let b=a;&lt;BR /&gt;%let c=%eval(find("&amp;amp;a", "&amp;amp;b"));&lt;BR /&gt;%put &amp;amp;c;&lt;BR /&gt;%mend test;&lt;BR /&gt;%test();&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 21:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555494#M154588</guid>
      <dc:creator>saras</dc:creator>
      <dc:date>2019-05-01T21:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Should %eval evaluate the FIND function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555495#M154589</link>
      <description>&lt;P&gt;%EVAL() is for integer calculations primarily or condition checks. For functions you want %SYSFUNC() which you need to wrap around each SAS function to differentiate it from text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use %SYSEVALF() to do decimal math.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/47540"&gt;@saras&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the following code (simplified from my original problem) I get the following error message :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: Required operator not found in expression: find("apple", "a")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ERROR: The macro TEST will stop executing.&lt;/P&gt;
&lt;P&gt;Is there any reason I cannot use the %eval on the find function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; %macro test();&lt;BR /&gt;%let a=apple;&lt;BR /&gt;%let b=a;&lt;BR /&gt;%let c=%eval(find("&amp;amp;a", "&amp;amp;b"));&lt;BR /&gt;%put &amp;amp;c;&lt;BR /&gt;%mend test;&lt;BR /&gt;%test();&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 21:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555495#M154589</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-01T21:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Should %eval evaluate the FIND function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555506#M154599</link>
      <description>&lt;P&gt;When running strictly macro code as you are the values of variables should seldom be inside quotes at all:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro test();
%let a=apple;
%let b=a;
%let c=%sysfunc(find("&amp;amp;a", "&amp;amp;b"));
%put Test value of c is &amp;amp;c;
%mend test;
%test(); 

%macro test2();
%let a=apple;
%let b=a;
%let c=%sysfunc(find(&amp;amp;a, &amp;amp;b));
%put Test2 value of c is &amp;amp;c;
%mend test2;

%test()
%test2()
&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 23:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555506#M154599</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-01T23:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Should %eval evaluate the FIND function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555582#M154627</link>
      <description>&lt;P&gt;Also, if there's a suitable &lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1qqdn7r170c30n197p4jfufv1yy.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;macro function&lt;/A&gt;, you don't need to call a DATA step function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let c=%index(&amp;amp;a, &amp;amp;b);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 12:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/555582#M154627</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-05-02T12:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Should %eval evaluate the FIND function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/562127#M157445</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;%EVAL() is for integer calculations primarily or condition checks. For functions you want %SYSFUNC() which you need to wrap around each SAS function to differentiate it from text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use %SYSEVALF() to do decimal math.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Additionally,&lt;/P&gt;
&lt;P&gt;%eval (and %sysevalf) can be used for boolean evaluations.&lt;/P&gt;
&lt;P&gt;%sysevalf can interpret SAS dates strings correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put =&amp;gt; %eval(%sysfunc(findw(bb ba,ba))&amp;gt;0); 
%put =&amp;gt; %sysevalf('01jan1990'd); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;=&amp;gt; 1&lt;BR /&gt;=&amp;gt; 10958&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 23:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Should-eval-evaluate-the-FIND-function/m-p/562127#M157445</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-05-28T23:47:02Z</dc:date>
    </item>
  </channel>
</rss>

