<?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: SAS %sysevalf does not support &amp;quot;IN&amp;quot; operator ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917580#M361439</link>
    <description>&lt;P&gt;They had to fix %EVAL() to recognize IN as an operator or else it would never have worked at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is because when you write something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;x = 5 %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is just an implied call to %EVAL() to evaluate the condition.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like an oversight to me.&amp;nbsp; &amp;nbsp;It has worked that way since the concept of allowing IN as an operator in the macro language was introduced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it something that needs to be fixed? Or just documented.&amp;nbsp; &amp;nbsp;Find the documentation page for %SYEVALF() on-line and click on the FEEDBACK button and send the SAS documentation team a request that they include the fact that it does not support IN as an operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2024 14:06:30 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-02-23T14:06:30Z</dc:date>
    <item>
      <title>SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917556#M361424</link>
      <description>&lt;P&gt;Hi SASsy People! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Counting on that your "sassyness" will help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inspired by discussion with Quentin (&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;sorry for pulling you into this &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; )&lt;/P&gt;
&lt;P&gt;I was working on new extension to my &lt;A href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus&lt;/A&gt; package and encountered this "interesting" situation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea was to concoct "lazy typer"/"syntactic sugar" macro name %IFFUN() which would allow for something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let test = %iffunc((&amp;lt;condition&amp;gt;),value when TRUE,value when FALSE);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(I know about the "%sysfunc(ifc(c,t,f,))" combo, that's not the point here.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to provide the conditions like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1) (&amp;amp;x.=1)
2) (9.9&amp;lt;&amp;amp;y)
3) (TRUE=true)
4) (1/3 = &amp;amp;z. * 0.5)
5) (1=1.0)
6) (%scan(&amp;amp;t.,1)=A)
etc.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and of course something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;7) (&amp;amp;n. IN (1 3 5))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Internally I'm using the %SYSEVALF() to evaluate expressions and everything was going well until the point 7).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the %SYSEVALF() macrofunction and the IN operator don't like each other...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets look at those 3 macros:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test1()/minoperator;
%if 1.1 IN (1.1 2.1 3.1) %then %put [&amp;amp;sysmacroname.] 123!!;
%mend;

%macro test2()/minoperator;
%if %eval(1.1 IN (1.1 2.1 3.1)) %then %put [&amp;amp;sysmacroname.] 123!!;
%mend;

%macro test3()/minoperator;
%if %sysevalf(1.1 IN (1.1 2.1 3.1)) %then %put [&amp;amp;sysmacroname.] 123!!;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would you expect to see in the log after running:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%test1()
%test2()
%test3()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would it be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %test1()
[TEST1] 123!!
2    %test2()
[TEST2] 123!!
3    %test3()
[TEST3] 123!!
&lt;/PRE&gt;
&lt;P&gt;??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, if yes, you would be surprised.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %test1()
[TEST1] 123!!
2    %test2()
[TEST2] 123!!
3    %test3()
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: (1.1 IN (1.1 2.1 3.1))
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST3 will stop executing.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my surprise, the error is not in "plain" %IF-%THEN, not in %EVAL(), but it blows-up in the %SYSEVALF() which seems to be "the most robust one"...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before writing here I went through:&lt;/P&gt;
&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/en/books/authors/art-carpenter.html" target="_blank" rel="noopener"&gt;https://support.sas.com/en/books/authors/art-carpenter.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;both:&lt;/P&gt;
&lt;P&gt;"Carpenter's Complete Guide to the SAS Macro Language, Third Edition"&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;"Carpenter’s Guide to Innovative SAS Techniques"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/en/books/authors/robert-virgile.html" target="_blank" rel="noopener"&gt;https://support.sas.com/en/books/authors/robert-virgile.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;"SAS Macro Language Magic: Discovering Advanced Techniques"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/author/micheleburlew/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/author/micheleburlew/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;"SAS Macro Programming Made Easy, Third Edition"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but didn't find anything related to or describing the subject.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also 9.4 documentation pages:&lt;/P&gt;
&lt;P&gt;- sysevalf -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1d9ypna2tpt16n1xam57kuffcpt.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1d9ypna2tpt16n1xam57kuffcpt.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- minoperator -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0pbehl7wj5sl4n1ov1ortnehtba.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0pbehl7wj5sl4n1ov1ortnehtba.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- mindelimiter= -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0vc5y2nyi55dvn1agla9j658kwh.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0vc5y2nyi55dvn1agla9j658kwh.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- macro expressions -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n00ks71pt5pjtfn1g939tuoptql4.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n00ks71pt5pjtfn1g939tuoptql4.htm&lt;/A&gt;&amp;nbsp;(all four sub-sections too)&lt;/P&gt;
&lt;P&gt;- macro error messages -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/mcrolref/1.0/n1mcxptbxr3qhwn1q6swv33z8akq.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/mcrolref/1.0/n1mcxptbxr3qhwn1q6swv33z8akq.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;don't provide any "warnings", "notes", or "attentions" to the subject.&lt;/P&gt;
&lt;P&gt;And it's not onlu 9.4... the same is for Viya doc too &lt;A href="https://documentation.sas.com/doc/en/mcrolref/1.0/p14qac7nd7n0s1n1rfte5bwrpfcy.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/mcrolref/1.0/p14qac7nd7n0s1n1rfte5bwrpfcy.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My questions to you are:&lt;/P&gt;
&lt;P&gt;0) Is it "well known" behaviour and it's just me who didn't smashed head on it yet?&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp;Did you encounter any place where the behaviour is documented (sas note)?&lt;/P&gt;
&lt;P&gt;2) Do you consider such behaviour a bug worth mentioning to SAS support?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm intentionally mentioning some of you in the post's comments hoping for your thoughts, insights, and, hopefully, some "good-old SAS-L" type discussion.&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>Fri, 23 Feb 2024 12:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917556#M361424</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T12:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917557#M361425</link>
      <description>&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12477"&gt;@RichardDeVen&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 12:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917557#M361425</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T12:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917558#M361426</link>
      <description>&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83849"&gt;@sasbrah&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 15:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917558#M361426</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T15:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917559#M361427</link>
      <description>&lt;P&gt;I tend to use the %INM macro rather than the IN operator&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro inm(slist,s);
    /* SAS Macro %inm to see if &amp;amp;s is contained in a string or list &amp;amp;slist                 */
    /* Borrowed from https://groups.google.com/forum/#!topic/comp.soft-sys.sas/fWcSDgg11tE */
    %if %sysfunc(indexw(&amp;amp;slist,&amp;amp;s)) gt 0 %then 1 ;
    %else 0;
%mend;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2024 12:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917559#M361427</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-23T12:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917560#M361428</link>
      <description>&lt;P&gt;What happens if you do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf(1 IN (1 2 3))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I'm on my tablet, so no SODA available)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 12:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917560#M361428</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-23T12:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917563#M361429</link>
      <description>&lt;P&gt;This:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test4()/minoperator;
%if %sysevalf(1 IN (1 2 3)) %then %put [&amp;amp;sysmacroname.] 123!!;
%mend;

%macro test5()/minoperator;
%if %sysevalf(A IN (A B C)) %then %put [&amp;amp;sysmacroname.] 123!!;
%mend;

%test4()
%test5()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;gives:&lt;/P&gt;
&lt;PRE&gt;1    %test4()
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 1 IN (1 2 3)
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST4 will stop executing.
2    %test5()
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: A IN (A B C)
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST5 will stop executing.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 12:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917563#M361429</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T12:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917564#M361430</link>
      <description>&lt;P&gt;So it's clear that it is not the data or type of data which causes this, SYSEVALF does not like the IN operator at all. This is either a bug or not properly documented.&lt;/P&gt;
&lt;P&gt;Since %IF can be used without a macro, I suggest to run the tests in "open code" with OPTIONS MINOPERATOR set. Maybe the log can give us additional clues.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917564#M361430</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-23T13:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917565#M361431</link>
      <description>&lt;P&gt;Have you enabled the Macro In Operator (MINOPERATOR) option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When SAS initially enabled the IN operator for the Macro language they got feedback from lots of customers that it broke their code (I can't recall the details, but I know that was the reason). So SAS added an option to enable that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies if that was mentioned earlier - based on a quick scan I did not see that mentioned.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917565#M361431</guid>
      <dc:creator>DonH</dc:creator>
      <dc:date>2024-02-23T13:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917567#M361432</link>
      <description>&lt;P&gt;Open code version:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options minoperator;
%if %sysevalf(1 IN (1 2 3)) %then 
  %do; 
    %put [Open Code] 123!!; 
  %end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;produces:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    options minoperator;
2    %if %sysevalf(1 IN (1 2 3)) %then
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 1 IN (1 2 3)
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: Skipping to next %END statement.
3      %do;
4        %put [Open Code] 123!!;
5      %end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Basically, nothing new.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917567#M361432</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T13:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917568#M361433</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;'s macro definitions have the /MINOPERATOR option, and %EVAL works there. It's only %SYSEVALF which coughs up.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917568#M361433</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-23T13:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917570#M361434</link>
      <description>&lt;P&gt;Hi Don,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I tried with both:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options minoperator;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro ... / minoperator;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;directly in macro definition.&lt;/P&gt;
&lt;P&gt;But it didn't change a thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917570#M361434</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T13:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917571#M361435</link>
      <description>&lt;P&gt;Just wanted to make sure there is no difference between the MINOPERATOR option of %MACRO&amp;nbsp; and the system option.&lt;/P&gt;
&lt;P&gt;Since it is not documented for the %SYSEVALF function, IMO this is a bug.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917571#M361435</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-23T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917572#M361436</link>
      <description>Have you tried turning on MLOGIC to see how the statements are being interpreted?</description>
      <pubDate>Fri, 23 Feb 2024 13:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917572#M361436</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-02-23T13:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917575#M361437</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a simplified version of the macro (with Windows SAS 9.4M5) &lt;EM&gt;SAS itself&lt;/EM&gt; admits that there is a bug:&lt;/P&gt;
&lt;PRE&gt;1     %macro test / minoperator;
2     %if %sysevalf(1 IN 1) %then %put OK;
3     %mend;
4
5     %test
&lt;FONT color="#FF0000"&gt;ERROR: A bug in SAS has been encountered. Please call your SAS representative and report the following message:
YJEVAL: Invalid arithmetic operator 26 encountered.

ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST will stop executing.&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;The first two lines of the error messages (what is YJEVAL, btw? And arithmetic operator 26?) are also written to the output window (in red color).&lt;/P&gt;
&lt;P&gt;(Same with condition&amp;nbsp;&lt;FONT face="courier new,courier"&gt;1 IN &lt;STRONG&gt;(&lt;/STRONG&gt;1&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;.)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917575#M361437</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-23T13:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917576#M361438</link>
      <description>&lt;P&gt;Yes, nothing worth mentioning:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    options mlogic mprint symbolgen;
2    %test5()
MLOGIC(TEST5):  Beginning execution.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: A IN (A B C)
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST5 will stop executing.
MLOGIC(TEST5):  Ending execution.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(based on one of earlier examples)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917576#M361438</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917580#M361439</link>
      <description>&lt;P&gt;They had to fix %EVAL() to recognize IN as an operator or else it would never have worked at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is because when you write something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;x = 5 %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is just an implied call to %EVAL() to evaluate the condition.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like an oversight to me.&amp;nbsp; &amp;nbsp;It has worked that way since the concept of allowing IN as an operator in the macro language was introduced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it something that needs to be fixed? Or just documented.&amp;nbsp; &amp;nbsp;Find the documentation page for %SYEVALF() on-line and click on the FEEDBACK button and send the SAS documentation team a request that they include the fact that it does not support IN as an operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917580#M361439</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-23T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917581#M361440</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the good news is it is a bug and it can be confirmed...&lt;/P&gt;
&lt;P&gt;Bad news it is there not fixed since M5! ...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here (&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1alyfc9f4qrten10sd5qz5e1w5q.htm)" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1alyfc9f4qrten10sd5qz5e1w5q.htm)&lt;/A&gt; in the table, if you count with mnemonics there is more than 26 operators, maybe IN is 26th? BTW. What happens if you replace "IN" with "#", like:&lt;/P&gt;
&lt;PRE&gt;%if %sysevalf(1 # 1) %then %put OK;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;YJEVAL&lt;/SPAN&gt;" - "something, something EVAL", maybe %YJEVAL() is like "Yet another Junky EVAL"? &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you also do test for "1 in (1 2 3)" ? Just to have a full picture for SAS Support team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917581#M361440</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T14:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917587#M361441</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here (&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1alyfc9f4qrten10sd5qz5e1w5q.htm)" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1alyfc9f4qrten10sd5qz5e1w5q.htm)&lt;/A&gt; in the table, if you count with mnemonics there is more than 26 operators, maybe IN is 26th? BTW. What happens if you replace "IN" with "#", like:&lt;/P&gt;
&lt;PRE&gt;%if %sysevalf(1 # 1) %then %put OK;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Almost the same as with "IN", but the number changed from 26 to 13:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;...
&lt;FONT color="#FF0000"&gt;YJEVAL: Invalid arithmetic operator 13 encountered.&lt;/FONT&gt;
...&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;Could you also do test for "1 in (1 2 3)" ? Just to have a full picture for SAS Support team.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Same messages as in your initial post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has just told me (twice!) that there will be an &lt;FONT face="courier new,courier"&gt;%IN&lt;/FONT&gt; operator (or at least a "reserved keyword" of this name) in a future SAS release.&lt;/P&gt;
&lt;PRE&gt;6     %macro test / minoperator;
7     %if %sysevalf(1 %IN 1) %then %put OK;
8     %mend;
9
10    %test
&lt;FONT color="#3366FF"&gt;NOTE: %IN will become a reserved keyword of the SAS Macro Language in a future release of the SAS System.  Changing the name of this macro will avoid
      future conflicts.&lt;/FONT&gt;
&lt;FONT color="#008000"&gt;WARNING: Apparent invocation of macro IN not resolved.&lt;/FONT&gt;
&lt;FONT color="#3366FF"&gt;NOTE: %IN will become a reserved keyword of the SAS Macro Language in a future release of the SAS System.  Changing the name of this macro will avoid
      future conflicts.&lt;/FONT&gt;
&lt;FONT color="#008000"&gt;WARNING: Apparent invocation of macro IN not resolved.&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 1 %IN 1
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro TEST will stop executing.&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;Maybe that will be more robust.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917587#M361441</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-23T14:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917588#M361442</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From 26 to 13, so maybe my guessing was right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;9.4M8 has the same note about %IN, so still not reserved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    %in
     -
     180
NOTE: %IN will become a reserved keyword of the SAS Macro Language in a future release of the SAS System.  Changing the name of this macro will avoid future conflicts.
WARNING: Apparent invocation of macro IN not resolved.

ERROR 180-322: Statement is not valid or it is used out of proper order.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917588#M361442</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-23T14:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS %sysevalf does not support "IN" operator ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917589#M361443</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Interesting thread, and glad to have the input from others! Agree with you and others that this feels very buggy.&amp;nbsp; I think it's worth reporting to SAS as a %SYSEVALF bug, and then they can decide whether to fix it or document it as a "feature." : )&lt;BR /&gt;&lt;BR /&gt;Personally, the introduction of the IN operator to the macro language was so buggy for several versions, that I've stayed away from it.&amp;nbsp; In the context of macro language IN bugs in prior versions, it's not too shocking for find another one.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-sysevalf-does-not-support-quot-IN-quot-operator/m-p/917589#M361443</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-02-23T14:41:03Z</dc:date>
    </item>
  </channel>
</rss>

