<?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: %if inside macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390421#M93649</link>
    <description>&lt;P&gt;In addition, you will need to specify what delimiter the IN operator should use.&amp;nbsp; A comma is permitted as the delimiter, but then you should not have spaces on either side of the commas in your %IF %THEN statement.&amp;nbsp; The&amp;nbsp;name of the global option is MINDELIMITER:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0vc5y2nyi55dvn1agla9j658kwh.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0vc5y2nyi55dvn1agla9j658kwh.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you will need to get rid of the parentheses around the list of items.&amp;nbsp; The macro language IN operator doesn't use them.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2017 20:33:50 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-08-23T20:33:50Z</dc:date>
    <item>
      <title>%if inside macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390413#M93644</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May you help with what is wrong about following macro? &amp;nbsp;Thank you. &amp;nbsp; -Ivy&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro t ;&lt;BR /&gt;%let group = 'SORAFENIB_1stline' ;&lt;/P&gt;&lt;P&gt;%if &amp;amp;group. in ( 'SORAFENIB_1stline' , 'commercial', 'Cirrhosis', 'meta') %then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(distinct enrolid) into: cntt&lt;BR /&gt;from ads.cohort ;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15 %macro t ;&lt;BR /&gt;16 %let group = 'SORAFENIB_1stline' ;&lt;BR /&gt;17&lt;BR /&gt;18 %if &amp;amp;group. in ( 'SORAFENIB_1stline' , 'commercial', 'Cirrhosis', 'meta') %then %do;&lt;BR /&gt;19 proc sql;&lt;BR /&gt;20 select count(distinct enrolid) into: cntt&lt;BR /&gt;21 from ads.cohort ;&lt;BR /&gt;22 quit;&lt;BR /&gt;23 %end;&lt;BR /&gt;24 %mend;&lt;BR /&gt;25&lt;BR /&gt;26 %t;&lt;BR /&gt;MLOGIC(T): Beginning execution.&lt;BR /&gt;MLOGIC(T): %LET (variable name is GROUP)&lt;BR /&gt;ERROR: Required operator not found in expression: &amp;amp;group. in ( 'SORAFENIB_1stline' , 'commercial', 'Cirrhosis', 'meta')&lt;BR /&gt;ERROR: The macro T will stop executing.&lt;BR /&gt;MLOGIC(T): Ending execution.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390413#M93644</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2017-08-23T20:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: %if inside macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390417#M93646</link>
      <description>&lt;P&gt;MINOPERATOR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IN wasn't always supported in SAS macros, so when it was added to keep backwards compatibility it requires you to set the option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check the docs on how the specifics work, but you can add it to your macro definition, which is the easiest option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro t / MINOPERATOR;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390417#M93646</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-23T20:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: %if inside macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390419#M93647</link>
      <description>Thank you very much, Reeza .</description>
      <pubDate>Wed, 23 Aug 2017 20:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390419#M93647</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2017-08-23T20:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: %if inside macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390421#M93649</link>
      <description>&lt;P&gt;In addition, you will need to specify what delimiter the IN operator should use.&amp;nbsp; A comma is permitted as the delimiter, but then you should not have spaces on either side of the commas in your %IF %THEN statement.&amp;nbsp; The&amp;nbsp;name of the global option is MINDELIMITER:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0vc5y2nyi55dvn1agla9j658kwh.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0vc5y2nyi55dvn1agla9j658kwh.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you will need to get rid of the parentheses around the list of items.&amp;nbsp; The macro language IN operator doesn't use them.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-inside-macro/m-p/390421#M93649</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-08-23T20:33:50Z</dc:date>
    </item>
  </channel>
</rss>

