<?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: Stop submitted statements without errors in the log in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168861#M32405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I have also had a look at endsas;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It prints no error message to the log, but it closes SAS entirely. I am hoping for something that stops the program, but leaves SAS open.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 15:31:46 GMT</pubDate>
    <dc:creator>Hedegaard</dc:creator>
    <dc:date>2013-12-10T15:31:46Z</dc:date>
    <item>
      <title>Stop submitted statements without errors in the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168859#M32403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a program that I run with a variety of parameters. For certain choices of parameters, I want a condition in the beginning of my program that says that the program should stop executing immediately, thus not completing all the following data steps and macro functions, but without printing an error message to the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The abort statement works, but it prints an error message to the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would like something in the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro stopProgram;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;parameter. = 1 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;command that stops the program from running, but doesn't print an error&amp;gt; &lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%stopProgram;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;rest of huge program&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to avoid having to wrap the entirety of the rest of the program in a large macro. Any ideas are appeciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Rasmus Hedegaard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 14:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168859#M32403</guid>
      <dc:creator>Hedegaard</dc:creator>
      <dc:date>2013-12-10T14:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Stop submitted statements without errors in the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168860#M32404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;endsas;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 14:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168860#M32404</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-12-10T14:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Stop submitted statements without errors in the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168861#M32405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I have also had a look at endsas;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It prints no error message to the log, but it closes SAS entirely. I am hoping for something that stops the program, but leaves SAS open.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 15:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168861#M32405</guid>
      <dc:creator>Hedegaard</dc:creator>
      <dc:date>2013-12-10T15:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stop submitted statements without errors in the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168862#M32406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want a %goto statement that branches to a place in your macro that has no code executing afterwards. That may require a macro to surrround all of your existing code for the logic to work.&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro control(&amp;lt;parameters needed&amp;gt;);&lt;/P&gt;&lt;P&gt;&amp;lt;start of code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*at problem location*/&lt;/P&gt;&lt;P&gt;%if &amp;amp;parameter = 1 %then %goto endit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;code you don't want to run&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%endit: %mend control; /* NOTE the full colon is used for the target label*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or use&lt;/P&gt;&lt;P&gt;%if &amp;amp;parameter = 1 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put NOTE: Program terminated because parameter &amp;amp;parameter was 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %goto endit;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;to provide a graceful message in the log about the termination.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 15:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-submitted-statements-without-errors-in-the-log/m-p/168862#M32406</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-12-10T15:51:29Z</dc:date>
    </item>
  </channel>
</rss>

