<?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: Macro if statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420457#M103478</link>
    <description>&lt;P&gt;What does your log say?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2017 13:23:05 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-12-12T13:23:05Z</dc:date>
    <item>
      <title>Macro if statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420434#M103471</link>
      <description>&lt;P&gt;Why does this code not work? It doesn't seem to like the multiple conditions inside the if statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;WATERFALL_RUN.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = N and &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SENSITIVITY_RUN.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = N &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;process_flow_ALL&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420434#M103471</guid>
      <dc:creator>rebeccas</dc:creator>
      <dc:date>2017-12-12T12:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro if statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420455#M103477</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by 'does not work' ?&lt;/P&gt;
&lt;P&gt;Are there error messages in the log ?&lt;/P&gt;
&lt;P&gt;There is nothing wrong with this code.&lt;/P&gt;
&lt;P&gt;Use mprint, mlogic and symbolgen options to check how the macro code is resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420455#M103477</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-12-12T13:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro if statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420457#M103478</link>
      <description>&lt;P&gt;What does your log say?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420457#M103478</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-12T13:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro if statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420460#M103479</link>
      <description>&lt;P&gt;It all depends on the contents of the macro variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro testmac;
%let waterfall_run=N;
%let sensitivity_run=N;
%if &amp;amp;WATERFALL_RUN. = N and &amp;amp;SENSITIVITY_RUN. = N %then %do; 
%put it works!;
%end;
%mend;

%testmac&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log from this:&lt;/P&gt;
&lt;PRE&gt;24         %macro testmac;
25         %let waterfall_run=N;
26         %let sensitivity_run=N;
27         %if &amp;amp;WATERFALL_RUN. = N and &amp;amp;SENSITIVITY_RUN. = N %then %do;
28         %put it works!;
29         %end;
30         %mend;
31         
32         %testmac
it works!
&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420460#M103479</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-12T13:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro if statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420500#M103494</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 15:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-if-statements/m-p/420500#M103494</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-12T15:32:06Z</dc:date>
    </item>
  </channel>
</rss>

