<?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 the SAS code execution based on error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698567#M213655</link>
    <description>&lt;P&gt;If you are after a simple solution then try options SYNTAXCHECK. Your session will remain open but remaining code will run but not process any data (OBS is set to 0). Not quite what you want you could well find it useful.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 02:48:55 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-11-13T02:48:55Z</dc:date>
    <item>
      <title>Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698429#M213602</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to stop the SAS code execution based on error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a SAS report, when I executing code by manually I need to stop the code if any error occurs during the data step or proc step, the code should be stopped at a time without the run remaining steps and the code should not close.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;A Ganesh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698429#M213602</guid>
      <dc:creator>ganeshsas764</dc:creator>
      <dc:date>2020-11-12T16:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698444#M213609</link>
      <description>&lt;P&gt;Try :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options errorabend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2020 17:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698444#M213609</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2020-11-12T17:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698485#M213628</link>
      <description>&lt;P&gt;The ERRORABEND option is a good one to use but is only useful for SAS batch jobs. It will immediately close your SAS session so unless you are running a batch job you will lose your SAS log and outputs so far.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698485#M213628</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-12T19:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698488#M213630</link>
      <description>If I use ERRORABEND in open code .. automatically sas session will close ..but i need to stop code with out closing session</description>
      <pubDate>Thu, 12 Nov 2020 19:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698488#M213630</guid>
      <dc:creator>ganeshsas764</dc:creator>
      <dc:date>2020-11-12T19:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698512#M213640</link>
      <description>&lt;P&gt;Wrap the code you don't want to execute in case of errors into this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;syscc. = 0 %then %do;

/* code *

%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is possible to use %IF like this in open code (outside a macro) since 9.4M5 (at least).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 20:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698512#M213640</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T20:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698567#M213655</link>
      <description>&lt;P&gt;If you are after a simple solution then try options SYNTAXCHECK. Your session will remain open but remaining code will run but not process any data (OBS is set to 0). Not quite what you want you could well find it useful.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 02:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698567#M213655</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-13T02:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the SAS code execution based on error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698575#M213661</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sadly this simple feature &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Create-new-statement-STOPROGRAMRIGHTHERE-or-similar/idi-p/332062" target="_self"&gt;has been requested&lt;/A&gt; for as long as I remember, and SAS never did anything.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow the link for a nasty workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way is to use&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%abort cancel;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data t; abort cancel; run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to test manually though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 04:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-SAS-code-execution-based-on-error/m-p/698575#M213661</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-13T04:34:22Z</dc:date>
    </item>
  </channel>
</rss>

