<?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 after %if in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196379#M266530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What SAS/EG version you have? It works for me on both SAS 9.3/9.4 with EG 5.1&lt;/P&gt;&lt;P&gt;On my test, it works even when parenthesis is present:&lt;/P&gt;&lt;P&gt;%macro test(a) /minoperator;&lt;/P&gt;&lt;P&gt;%if %upcase(&amp;amp;a) in (A B C) %then %put Hello;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;%test(a)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Mar 2015 19:34:43 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2015-03-06T19:34:43Z</dc:date>
    <item>
      <title>'in' operator after %if in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196377#M266528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Can I use 'in' operator in macros? It seems the following code doesn't work. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%macro test(a);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%upcase&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(&amp;amp;a.&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) in (A, B, C) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;let&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; name = Mike;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%mend test;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 18:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196377#M266528</guid>
      <dc:creator>swimmer</dc:creator>
      <dc:date>2015-03-06T18:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: 'in' operator after %if in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196378#M266529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I tried this in PC SAS and it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%macro test(a) /minoperator;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%upcase&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(&amp;amp;a) in A B C &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Hello;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%mend test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%test(a);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;However, it doesn't work in SAS EG. Any other suggestion? Do I have to write them by ' xxx&amp;nbsp; or xxx or xxx'? Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 19:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196378#M266529</guid>
      <dc:creator>swimmer</dc:creator>
      <dc:date>2015-03-06T19:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: 'in' operator after %if in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196379#M266530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What SAS/EG version you have? It works for me on both SAS 9.3/9.4 with EG 5.1&lt;/P&gt;&lt;P&gt;On my test, it works even when parenthesis is present:&lt;/P&gt;&lt;P&gt;%macro test(a) /minoperator;&lt;/P&gt;&lt;P&gt;%if %upcase(&amp;amp;a) in (A B C) %then %put Hello;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;%test(a)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 19:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196379#M266530</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-03-06T19:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: 'in' operator after %if in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196380#M266531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a reference article I found handy for working with the in operator in macros.&amp;nbsp; It entails listing the 'in' delimiter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Sample &lt;EM&gt;35591: &lt;/EM&gt;How to use the new macro IN operator for SAS 9.2&lt;/H2&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/35/591.html"&gt;http://support.sas.com/kb/35/591.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting SAS 9.2, there is an IN operator for the macro language. The IN operator can now be used on the %IF statement when the MINOPERATOR option is set on the %MACRO statement or as a SAS system option. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options minoperator mlogic;&lt;/P&gt;&lt;P&gt;%macro test(value)/mindelimiter=',';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;value in 1,2,3,4,5,6 %then&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put Value found within list.;&lt;/P&gt;&lt;P&gt;%else %put Value not in list.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 19:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196380#M266531</guid>
      <dc:creator>SASMike</dc:creator>
      <dc:date>2015-03-06T19:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: 'in' operator after %if in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196381#M266532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked for me now. I probably did something wrong with the minoperator option. After I restart the SAS EG, it worked! Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 19:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/in-operator-after-if-in-macro/m-p/196381#M266532</guid>
      <dc:creator>swimmer</dc:creator>
      <dc:date>2015-03-06T19:40:30Z</dc:date>
    </item>
  </channel>
</rss>

