<?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: Problem with using string IN operator in Macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541181#M149381</link>
    <description>&lt;P&gt;Correction&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options minoperator;
%macro test(value)/mindelimiter=',';
Data _Null_;
CALL SYMPUT('Vendor',2);
run;

%DO I=1 %TO &amp;amp;Vendor; /* LOOP THRU ALL Vendors */
%PUT *** LOOP &amp;amp;I OF &amp;amp;Vendor;
%if &amp;amp;value in (Hari RRR,John yy,Peter,Jai,Phano )%then

%put Value found within list.;

%else %put Value not in list.;
%end;

%mend;
%test(Hari RRR)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;You don't need suffix &amp;amp;i in&amp;nbsp;&amp;amp;value&amp;amp;I &lt;/EM&gt;&lt;/STRONG&gt;coz macro parameter value is the name of the macro var and the value is Hari RRR. You do not have a series here.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2019 18:56:59 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-03-07T18:56:59Z</dc:date>
    <item>
      <title>Problem with using string IN operator in Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541178#M149380</link>
      <description>&lt;P&gt;options minoperator mlogic;&lt;/P&gt;&lt;P&gt;%macro test(value)/mindelimiter=',';&lt;BR /&gt;Data _Null_;&lt;BR /&gt;CALL SYMPUT('Vendor',2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%DO I=1 %TO &amp;amp;Vendor; /* LOOP THRU ALL Vendors */&lt;BR /&gt;%PUT *** LOOP &amp;amp;I OF &amp;amp;Vendor;&lt;/P&gt;&lt;P&gt;%if &amp;amp;value&amp;amp;I in Hari RRR,John yy,Peter,Jai,Phano %then&lt;/P&gt;&lt;P&gt;%put Value found within list.;&lt;/P&gt;&lt;P&gt;%else %put Value not in list.;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%test(Hari RRR);&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 18:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541178#M149380</guid>
      <dc:creator>Lakshmisas</dc:creator>
      <dc:date>2019-03-07T18:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with using string IN operator in Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541181#M149381</link>
      <description>&lt;P&gt;Correction&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options minoperator;
%macro test(value)/mindelimiter=',';
Data _Null_;
CALL SYMPUT('Vendor',2);
run;

%DO I=1 %TO &amp;amp;Vendor; /* LOOP THRU ALL Vendors */
%PUT *** LOOP &amp;amp;I OF &amp;amp;Vendor;
%if &amp;amp;value in (Hari RRR,John yy,Peter,Jai,Phano )%then

%put Value found within list.;

%else %put Value not in list.;
%end;

%mend;
%test(Hari RRR)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;You don't need suffix &amp;amp;i in&amp;nbsp;&amp;amp;value&amp;amp;I &lt;/EM&gt;&lt;/STRONG&gt;coz macro parameter value is the name of the macro var and the value is Hari RRR. You do not have a series here.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 18:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541181#M149381</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-07T18:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with using string IN operator in Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541199#M149385</link>
      <description>Why do you have data in macro-variables?</description>
      <pubDate>Thu, 07 Mar 2019 19:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541199#M149385</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-07T19:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with using string IN operator in Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541255#M149406</link>
      <description>&lt;P&gt;While you have received a good suggestion, the context is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should use &amp;amp;VALUE, not &amp;amp;VALUE&amp;amp;I:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;value in ........;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, do NOT add parentheses around your existing list of values.&amp;nbsp; The corrected version would simply be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;value in Hari RRR,John yy,Peter,Jai,Phano %then&lt;/P&gt;
&lt;P&gt;%put Value found within list.;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-using-string-IN-operator-in-Macros/m-p/541255#M149406</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-07T22:17:26Z</dc:date>
    </item>
  </channel>
</rss>

