<?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: Always auto run macro after submitting a sas code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125479#M25621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am still exploring. I am not running a batch jobs. I am using SAS Display Manager interactive. Sometimes, I am tired to trying to read the long logs, I want it to play a loud sound.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Checking Macro will be based on this paper, but instead of emailing me, it will play a sound.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf" title="http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf"&gt;http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2012 06:19:10 GMT</pubDate>
    <dc:creator>hellind</dc:creator>
    <dc:date>2012-05-25T06:19:10Z</dc:date>
    <item>
      <title>Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125472#M25614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a macro %ERR that checks for error and play a sound. I want this macro to run it every time when I execute a code. Instead of manually running %ERR, is there anywhere to setup in Preferences so that it automatically runs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a similar feature in Tools &amp;gt; Options &amp;gt; Preferences &amp;gt; Results for HTML Output which is very useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 02:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125472#M25614</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2012-05-24T02:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125473#M25615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you mean.&amp;nbsp; Are you running programs interactively from the SAS Display Manager?&amp;nbsp; Then you can issue any commands you want and even define keys to execute the commands for you. You can even add icons to run the commands.&amp;nbsp; For example you could define the F8 key to be the command sequence submit followed by the gsub command to submit the call to your %ERR macro. You can also define command macros that instead of generating SAS program statements can be used to generate Display Manager commands like submit or gsub.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 03:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125473#M25615</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-05-24T03:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125474#M25616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. SAS offer a system option to solve such problem. You can populate the statements of the macro into this option . and these statements will execute after the code running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TERMSTMT= System Option&lt;/P&gt;&lt;P&gt;Specifies the SAS statements to execute when SAS terminates.&lt;/P&gt;&lt;P&gt;Valid in: configuration file, SAS invocation&lt;/P&gt;&lt;P&gt;Category: Environment control: Initialization and operation&lt;/P&gt;&lt;P&gt;PROC OPTIONS GROUP= EXECMODES&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;TERMSTMT=’statement(s)’&lt;/P&gt;&lt;P&gt;Syntax Description&lt;/P&gt;&lt;P&gt;’statement(s)’&lt;/P&gt;&lt;P&gt;is one or more SAS statements.&lt;/P&gt;&lt;P&gt;Maximum length: 2,048 characters&lt;/P&gt;&lt;P&gt;Operating Environment Information: In some operating system environments there is&lt;/P&gt;&lt;P&gt;a limit to the size of the value for TERMSTMT=. To circumvent this limitation, you can&lt;/P&gt;&lt;P&gt;use the %INCLUDE statement.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Details&lt;/P&gt;&lt;P&gt;TERMSTMT= is fully supported in batch mode. In interactive modes, TERMSTMT= is&lt;/P&gt;&lt;P&gt;executed only when you submit the ENDSAS statement from an editor window to&lt;/P&gt;&lt;P&gt;terminate the SAS session. Terminating SAS by any other means in interactive mode&lt;/P&gt;&lt;P&gt;results in TERMSTMT= not being executed.&lt;/P&gt;&lt;P&gt;An alternate method for specifying TERMSTMT= is to put a %INCLUDE statement&lt;/P&gt;&lt;P&gt;at the end of a batch file or to submit a %INCLUDE statement before terminating the&lt;/P&gt;&lt;P&gt;SAS session in interactive mode.&lt;/P&gt;&lt;P&gt;Comparisons&lt;/P&gt;&lt;P&gt;TERMSTMT= specifies the SAS statements to be executed at SAS termination, and&lt;/P&gt;&lt;P&gt;INITSTMT= specifies the SAS statements to be executed at SAS initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 03:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125474#M25616</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-24T03:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125475#M25617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a warped approach. Redefine your macro as&lt;/P&gt;&lt;P&gt;%macro Run;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;lt;code from your ERR macro here&amp;gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then any proc or data step you want end with %run; instead of a simple run; statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the issue is getting tired of typing the macro into the code then create an editor macro to insert the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom's approach is probably better though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 14:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125475#M25617</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-05-24T14:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125476#M25618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to see your error checking code if you're prepared to share?&amp;nbsp; I've long been trying to write something which determines whether an error occurs and can decide whether to submit further statements or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 22:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125476#M25618</guid>
      <dc:creator>CBADavid</dc:creator>
      <dc:date>2012-05-24T22:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125477#M25619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this would help you cancel further statements in case of errors David:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/825.html"&gt;http://support.sas.com/kb/24/825.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 23:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125477#M25619</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2012-05-24T23:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125478#M25620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;TERMSTMT= is fully supported in batch mode. In interactive modes, TERMSTMT= is executed only when you submit the ENDSAS statement from an editor window to terminate the SAS session. Terminating SAS by any other means in interactive mode results in TERMSTMT= not being executed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;I am using SAS Display Manager. I want it to play a loud sound when it hits a error. TERMSTMT can be used in &lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #e7e7e5;"&gt;SAS invocation&lt;/SPAN&gt; which is good. But it seems it only executes when SAS terminates. (ENDSAS will close SAS session which I do not want)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 14px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 14px; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif;"&gt;I am exploring all the solutions suggested in this thread. Thanks. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 06:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125478#M25620</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2012-05-25T06:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125479#M25621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am still exploring. I am not running a batch jobs. I am using SAS Display Manager interactive. Sometimes, I am tired to trying to read the long logs, I want it to play a loud sound.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Checking Macro will be based on this paper, but instead of emailing me, it will play a sound.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf" title="http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf"&gt;http://www.nesug.org/proceedings/nesug05/ap/ap9.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 06:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125479#M25621</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2012-05-25T06:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125480#M25622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..Hellind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you find any solution for this.? Am searching for same kind of solution..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kishore Vengala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 05:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125480#M25622</guid>
      <dc:creator>kishore415</dc:creator>
      <dc:date>2012-10-12T05:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Always auto run macro after submitting a sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125481#M25623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do that with SAS Enterprise Guide.&amp;nbsp; See: Tool&amp;gt;Options&amp;gt;SAS Programs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 13:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Always-auto-run-macro-after-submitting-a-sas-code/m-p/125481#M25623</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-10-12T13:46:50Z</dc:date>
    </item>
  </channel>
</rss>

