<?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: IN operator in SAS MACRO in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768252#M243660</link>
    <description>&lt;P&gt;Your code runs fine for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %macro test(a) /minoperator;
2
3    %if %upcase(&amp;amp;a) in (FI BI CA) %then %put Hello;
4    %else %put ERROR;
5    %mend test;
6
7    %test(FI)
Hello
&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Sep 2021 10:52:34 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2021-09-17T10:52:34Z</dc:date>
    <item>
      <title>IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768235#M243653</link>
      <description>&lt;P&gt;while executing below code of IN operator , the Block resolves to ERROR instead of Hello , when i pass input parameter as FI&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro test(a) /minoperator;&lt;/P&gt;
&lt;P&gt;%if %upcase(&amp;amp;a) in (FI BI CA) %then %put Hello;&lt;BR /&gt;%else %put ERROR;&lt;BR /&gt;%mend test;&lt;/P&gt;
&lt;P&gt;%test(FI)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the Log :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 The SAS System Friday, September 17, 2021 08:57:00 AM&lt;/P&gt;
&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program 6';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='C:\Users\B723166\Desktop\Test23.egp';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='OPJTYTRU99146';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='Test23.egp';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10 &lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=SVG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16 %mend;&lt;BR /&gt;17 FILENAME EGHTML TEMP;&lt;BR /&gt;18 ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19 OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20 %HTML5AccessibleGraphSupported&lt;BR /&gt;21 ENCODING='utf-8'&lt;BR /&gt;22 STYLE=HtmlBlue&lt;BR /&gt;23 NOGTITLE&lt;BR /&gt;24 NOGFOOTNOTE&lt;BR /&gt;25 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26 ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27 &lt;BR /&gt;28 %macro test(a) /minoperator;&lt;BR /&gt;29 &lt;BR /&gt;30 %if %upcase(&amp;amp;a) in (FI BI CA) %then %put Hello;&lt;BR /&gt;31 %else %put ERROR;&lt;BR /&gt;32 %mend test;&lt;BR /&gt;33 &lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#FF0000"&gt;34 %test(FI)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#FF0000"&gt;ERROR&lt;/FONT&gt;&lt;BR /&gt;35 &lt;BR /&gt;36 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;37 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;38 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;39 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;40 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;41 %LET _SASPROGRAMFILE=;&lt;BR /&gt;42 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;43 &lt;BR /&gt;44 ;*';*";*/;quit;run;&lt;BR /&gt;45 ODS _ALL_ CLOSE;&lt;BR /&gt;46 &lt;BR /&gt;47 &lt;BR /&gt;48 QUIT; RUN;&lt;BR /&gt;49&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 09:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768235#M243653</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2021-09-17T09:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768236#M243654</link>
      <description>&lt;P&gt;You are missing quoting from&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;%if %upcase(&amp;amp;a) in (FI BI CA) %then %put Hello;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try :&amp;nbsp;%if %upcase(&amp;amp;a) in ('FI','BI','CA') %then %put Hello;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 09:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768236#M243654</guid>
      <dc:creator>Aku</dc:creator>
      <dc:date>2021-09-17T09:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768239#M243657</link>
      <description>&lt;P&gt;Remember to use the Options Minoperator.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 09:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768239#M243657</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-09-17T09:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768252#M243660</link>
      <description>&lt;P&gt;Your code runs fine for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %macro test(a) /minoperator;
2
3    %if %upcase(&amp;amp;a) in (FI BI CA) %then %put Hello;
4    %else %put ERROR;
5    %mend test;
6
7    %test(FI)
Hello
&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 10:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768252#M243660</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-09-17T10:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768271#M243667</link>
      <description>&lt;P&gt;Thanks for all valuable inputs it works now.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 12:35:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768271#M243667</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2021-09-17T12:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768289#M243674</link>
      <description>&lt;P&gt;This accepted solution looks wrong to me.&amp;nbsp; You shouldn't need quote marks in the macro language, as shown in the log I posted showing that the original code posted in the question works correctly.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768289#M243674</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-09-17T13:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: IN operator in SAS MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768293#M243677</link>
      <description>&lt;P&gt;I agree,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;. The solution marked correct, in fact is not correct.&amp;nbsp;&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/225493"&gt;@learn_SAS_23&lt;/a&gt;&amp;nbsp;Please un-mark that solution as correct.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-operator-in-SAS-MACRO/m-p/768293#M243677</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-17T13:48:07Z</dc:date>
    </item>
  </channel>
</rss>

