<?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 multiple conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808401#M318767</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working within proc report and have a macro that sends out the output depending on which group I call.&amp;nbsp; Each group has different column headers, however I have 5 groups that have the same headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For&amp;nbsp; example (portion of code):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;nbr. =1 %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods listing close;&lt;BR /&gt;ods tagsets.rtf file = "&amp;amp;&amp;amp;outpath&amp;amp;nbr" &amp;amp;repopt;&lt;BR /&gt;title3 "&amp;amp;&amp;amp;ttlnum&amp;amp;nbr";&lt;BR /&gt;title4 "&amp;amp;ttldesc";&lt;BR /&gt;title5 "&amp;amp;&amp;amp;ttlpop&amp;amp;nbr";&lt;BR /&gt;title6 "Part 1 of 2";&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc report data = final&amp;amp;pop headline headskip nowindows missing split = "@"&lt;BR /&gt;style = [protectspecialchars = off] style(report) = [bordertopwidth = 1.5] spanrows;&lt;BR /&gt;columns brk ptord aedecod text _1 ("Bupivacaine HCl &amp;amp;ulspan" _2 _3 _4 _98) sp ("HTX-011 &amp;amp;ulspan" _99);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I there a way to change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;nbr. =1 %then %do.....to something like this&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;%if &amp;amp;nbr. in (1 2 3 4 5)&amp;nbsp; %then %do&amp;nbsp; ((OF COURSE THIS NOT WORKING))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So when I call macro&lt;/P&gt;
&lt;P&gt;example:&amp;nbsp; %rept (1,POP1);%rept (2,POP2); %rept (3,POP3);%rept (4,POP4);%rept (5,POP5)...they will all use all use the same report columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Apr 2022 19:45:04 GMT</pubDate>
    <dc:creator>jenim514</dc:creator>
    <dc:date>2022-04-18T19:45:04Z</dc:date>
    <item>
      <title>macro multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808401#M318767</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working within proc report and have a macro that sends out the output depending on which group I call.&amp;nbsp; Each group has different column headers, however I have 5 groups that have the same headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For&amp;nbsp; example (portion of code):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;nbr. =1 %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods listing close;&lt;BR /&gt;ods tagsets.rtf file = "&amp;amp;&amp;amp;outpath&amp;amp;nbr" &amp;amp;repopt;&lt;BR /&gt;title3 "&amp;amp;&amp;amp;ttlnum&amp;amp;nbr";&lt;BR /&gt;title4 "&amp;amp;ttldesc";&lt;BR /&gt;title5 "&amp;amp;&amp;amp;ttlpop&amp;amp;nbr";&lt;BR /&gt;title6 "Part 1 of 2";&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc report data = final&amp;amp;pop headline headskip nowindows missing split = "@"&lt;BR /&gt;style = [protectspecialchars = off] style(report) = [bordertopwidth = 1.5] spanrows;&lt;BR /&gt;columns brk ptord aedecod text _1 ("Bupivacaine HCl &amp;amp;ulspan" _2 _3 _4 _98) sp ("HTX-011 &amp;amp;ulspan" _99);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I there a way to change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;nbr. =1 %then %do.....to something like this&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;%if &amp;amp;nbr. in (1 2 3 4 5)&amp;nbsp; %then %do&amp;nbsp; ((OF COURSE THIS NOT WORKING))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So when I call macro&lt;/P&gt;
&lt;P&gt;example:&amp;nbsp; %rept (1,POP1);%rept (2,POP2); %rept (3,POP3);%rept (4,POP4);%rept (5,POP5)...they will all use all use the same report columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 19:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808401#M318767</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2022-04-18T19:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: macro multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808405#M318770</link>
      <description>&lt;P&gt;You can use OR conditions in macro IF statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;nbr. = 1 %or  &amp;amp;nbr. = 2 %or &amp;amp;nbr. = 3 %or &amp;amp;nbr. = 4 %or &amp;amp;nbr. =  5 %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 19:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808405#M318770</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-04-18T19:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: macro multiple conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808417#M318774</link>
      <description>&lt;P&gt;To get your macro version of the IN operator to work, you need to turn on the MINOPERATOR option, and set the MINDELIMITER option to be a space in the %MACRO statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro rept( )/minoperator mindelimiter=' ';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 20:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-multiple-conditions/m-p/808417#M318774</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-18T20:29:36Z</dc:date>
    </item>
  </channel>
</rss>

