<?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 macro comparison operator in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21261#M3395</link>
    <description>The first macro pgm does not work in SAS 9.1.3.  An alternative is to use the second one, however, I'd rather not repeat the "proc print data=test;run;" section since it's actually very long in my pgm.  Perhaps I'm having a brain cramp, but I haven't been able to come up with an alternative.  Can someone help?  (&amp;amp;runflg comes in from another part of the pgm).  Thanks, Bill&lt;BR /&gt;
&lt;BR /&gt;
%macro report; %*First;                                                                                                                         &lt;BR /&gt;
                                                                                                          &lt;BR /&gt;
%if &amp;amp;runflg in 1,5 %then %do;                                                                                                           &lt;BR /&gt;
proc print &lt;BR /&gt;
data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%mend report;                                                                                                                           &lt;BR /&gt;
%report;                                                                                                                                &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%macro report;%*Second;&lt;BR /&gt;
                                                                                                                &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%if &amp;amp;runflg = 1 %then %do;                                                                                                              &lt;BR /&gt;
proc print data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%else %if &amp;amp;runflg = 5 %then %do;                                                                                                        &lt;BR /&gt;
proc print data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%mend report;                                                                                                                           &lt;BR /&gt;
%report;

changed %runflg to &amp;amp;runflg&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Bill</description>
    <pubDate>Tue, 27 May 2008 19:30:00 GMT</pubDate>
    <dc:creator>Bill</dc:creator>
    <dc:date>2008-05-27T19:30:00Z</dc:date>
    <item>
      <title>macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21261#M3395</link>
      <description>The first macro pgm does not work in SAS 9.1.3.  An alternative is to use the second one, however, I'd rather not repeat the "proc print data=test;run;" section since it's actually very long in my pgm.  Perhaps I'm having a brain cramp, but I haven't been able to come up with an alternative.  Can someone help?  (&amp;amp;runflg comes in from another part of the pgm).  Thanks, Bill&lt;BR /&gt;
&lt;BR /&gt;
%macro report; %*First;                                                                                                                         &lt;BR /&gt;
                                                                                                          &lt;BR /&gt;
%if &amp;amp;runflg in 1,5 %then %do;                                                                                                           &lt;BR /&gt;
proc print &lt;BR /&gt;
data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%mend report;                                                                                                                           &lt;BR /&gt;
%report;                                                                                                                                &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%macro report;%*Second;&lt;BR /&gt;
                                                                                                                &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%if &amp;amp;runflg = 1 %then %do;                                                                                                              &lt;BR /&gt;
proc print data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%else %if &amp;amp;runflg = 5 %then %do;                                                                                                        &lt;BR /&gt;
proc print data=test;                                                                                                                   &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
%end;                                                                                                                                   &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
%mend report;                                                                                                                           &lt;BR /&gt;
%report;

changed %runflg to &amp;amp;runflg&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Bill</description>
      <pubDate>Tue, 27 May 2008 19:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21261#M3395</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2008-05-27T19:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21262#M3396</link>
      <description>of course the OR logic would provide a substitute for IN &lt;BR /&gt;
However, IN should be working..... if you set system option different from the default    NOmInOperator  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
Try&lt;BR /&gt;
%put abc = %eval( 1 in 1 2 3 ) ;&lt;BR /&gt;
%put def = %eval( 1 in 1,2, 3 ) ;&lt;BR /&gt;
&lt;BR /&gt;
If you want to use a comma separator for the IN list, then set option mInDeliminator&lt;BR /&gt;
&lt;BR /&gt;
Good Luck&lt;BR /&gt;
PeterC</description>
      <pubDate>Tue, 27 May 2008 20:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21262#M3396</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2008-05-27T20:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21263#M3397</link>
      <description>sorry,&lt;BR /&gt;
that last posting was using options from SAS9.2&lt;BR /&gt;
which introduces the IN operator to the SAS Macro language.&lt;BR /&gt;
  &lt;BR /&gt;
For SAS 9.1.3 you need to create your own,  or use  OR, like [pre]&lt;BR /&gt;
   %if &amp;amp;runflg = 1 OR &amp;amp;runflg =5 %then %do; &lt;BR /&gt;
[/pre]&lt;BR /&gt;
Good Luck&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 29 May 2008 08:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21263#M3397</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-29T08:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21264#M3398</link>
      <description>Thank you Peter.&lt;BR /&gt;
&lt;BR /&gt;
How odd (to me at least) that it's not %OR.&lt;BR /&gt;
&lt;BR /&gt;
wd</description>
      <pubDate>Thu, 29 May 2008 16:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21264#M3398</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2008-05-29T16:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21265#M3399</link>
      <description>Hi,&lt;BR /&gt;
i tried to use IN but it does not work (lvl 9.1.3) and reading you messages it works from 9.2 explains a lot&lt;BR /&gt;
BUT read the sas help: &lt;A href="http://support.sas.com/onlinedoc/913/getDoc/nl/mcrolref.hlp/a002475219.htm" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/nl/mcrolref.hlp/a002475219.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Here it says it should work from level 9 !!!&lt;BR /&gt;
&lt;BR /&gt;
GreetZ,&lt;BR /&gt;
Herman</description>
      <pubDate>Wed, 08 Oct 2008 09:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21265#M3399</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-08T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: macro comparison operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21266#M3400</link>
      <description>Here's the explanation for that:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/11/945.html" target="_blank"&gt;http://support.sas.com/kb/11/945.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 08 Oct 2008 10:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-comparison-operator/m-p/21266#M3400</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-10-08T10:30:47Z</dc:date>
    </item>
  </channel>
</rss>

