<?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 automating macros w/ if &amp; then statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22769#M3706</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;Question-&lt;/P&gt;&lt;P&gt;If i want to simply end the program if it does not fall on a specific day, how does that go? &lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lawrence &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Oct 2011 20:20:48 GMT</pubDate>
    <dc:creator>_LB</dc:creator>
    <dc:date>2011-10-07T20:20:48Z</dc:date>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22766#M3703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks!&lt;/P&gt;&lt;P&gt;A small question concerning the automation of macro's-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO let's say I have %a &amp;amp; %b that I want to run under certain circumstances-&lt;/P&gt;&lt;P&gt;Lets say that if the day of the month is between 1 and 7 I want %a to run otherwise I want %b to run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lawrence &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 17:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22766#M3703</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-10-03T17:41:46Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22767#M3704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be with a third macro.&amp;nbsp; Something like the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro driver;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %sysfunc(day(%sysfunc(today()))) le 7 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend driver;&lt;/P&gt;&lt;P&gt;%driver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 17:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22767#M3704</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-03T17:54:24Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22768#M3705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Art.&lt;/P&gt;&lt;P&gt;That helps. I was close but was missing an element or two.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 23:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22768#M3705</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-10-03T23:47:36Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22769#M3706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;Question-&lt;/P&gt;&lt;P&gt;If i want to simply end the program if it does not fall on a specific day, how does that go? &lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lawrence &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 20:20:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22769#M3706</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-10-07T20:20:48Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22770#M3707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that would depend on precisely what you want to happen next.&amp;nbsp; If you just want to stop a currently running data step you could always just route the code to a stop statement.&amp;nbsp; e.g.,&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/viewer.htm#programstatements_sect16.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/viewer.htm#programstatements_sect16.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 20:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22770#M3707</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-07T20:25:33Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22771#M3708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the link, however, It is part of a larger macro so that I just want to "kill" the program if it doesn't fall on a specific day, plus actually I have a few programs bundled as well so I don't want to recode everything again.&amp;nbsp; Is this feasible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Lawrence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro driver;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %sysfunc(day(%sysfunc(today()))) le 7 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "KILL PROGRAM" ? &lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend driver;&lt;/P&gt;&lt;P&gt;%driver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 20:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22771#M3708</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-10-07T20:32:40Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22772#M3709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have numerous options depending on just what you want to terminate, e.g., abend, abort and systask.&amp;nbsp; Take a look at the following thread: &lt;A href="http://www.mathkb.com/Uwe/Forum.aspx/sas/41557/Re-Kill-the-sas-program-if-it-runs-too-long"&gt;http://www.mathkb.com/Uwe/Forum.aspx/sas/41557/Re-Kill-the-sas-program-if-it-runs-too-long&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 20:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22772#M3709</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-07T20:59:36Z</dc:date>
    </item>
    <item>
      <title>automating macros w/ if &amp; then statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22773#M3710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah yes-the good ole %abort function. Thanks &amp;amp; Have a great weekend!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2011 21:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-macros-w-if-then-statements/m-p/22773#M3710</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-10-07T21:13:29Z</dc:date>
    </item>
  </channel>
</rss>

