<?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 Stopping SAS program if an error occurs in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53554#M14806</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aborts from SAS session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TEST1;&lt;/P&gt;&lt;P&gt;SET TEST;&lt;/P&gt;&lt;P&gt;IF &amp;lt;CONDITION&amp;gt; THEN ABORT ABEND 123;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2012 20:55:41 GMT</pubDate>
    <dc:creator>Hima</dc:creator>
    <dc:date>2012-02-15T20:55:41Z</dc:date>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53547#M14799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any code that I can insert in my existing sas program which will stop the sas code from running if an error occurs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53547#M14799</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-02-14T15:34:53Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53548#M14800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if _error_=1 then stop;&amp;nbsp; to stop the current datastep or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if _error_=1 then abort; to stop the SAS session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53548#M14800</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-02-14T15:51:42Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53549#M14801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"...will stop the sas code from running" can mean a lot of things.&lt;/P&gt;&lt;P&gt;Depending on that, and how you are executing the program, there a very many alternatives how write your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a an error occur, in most situations SAS will go into syntax check mode, and the rest of the program will just compile, not execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Linus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 15:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53549#M14801</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-02-14T15:55:47Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53550#M14802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where would I put this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I want SAS to run the entire program and stop running the code when an error occurs....so that I can look at the log and fix it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 16:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53550#M14802</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-02-14T16:03:46Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53551#M14803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if just for debug purpose, you don't need to do anything (no addtional coding needed) except checking your log. Your log will tell you when _error_ has been set to 1, where you just have had an error occurred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 16:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53551#M14803</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-02-14T16:08:40Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53552#M14804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option is to simply add the word ' cancel' after your run statement (see: &lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0611A&amp;amp;L=sas-l&amp;amp;P=R18708&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1"&gt;http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0611A&amp;amp;L=sas-l&amp;amp;P=R18708&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will cause SAS to ONLY look for syntax errors and NOT actually run the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 16:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53552#M14804</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-14T16:14:17Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53553#M14805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Use system option errorabend at the very beginning of your code, i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options errorabend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;more sas code&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 15:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53553#M14805</guid>
      <dc:creator>jemmat</dc:creator>
      <dc:date>2012-02-15T15:43:07Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53554#M14806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aborts from SAS session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TEST1;&lt;/P&gt;&lt;P&gt;SET TEST;&lt;/P&gt;&lt;P&gt;IF &amp;lt;CONDITION&amp;gt; THEN ABORT ABEND 123;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 20:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53554#M14806</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-02-15T20:55:41Z</dc:date>
    </item>
    <item>
      <title>Stopping SAS program if an error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53555#M14807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are running interactively, you might want to look at OPTIONS DMSSYNCHK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be warned that (at least IMHO) SAS seriously broke it when they went to SAS 9.2; in SAS 9.1.3 it reset every time you submitted something, making it a very useful option to keep subsequent steps from running if an error occured. In SAS 9.2 if the DMSSYNCHK option is set and an error is caught you have to restart SAS to get it to behave again, which is enough of a p.i.t.a. that I quit using it. Don't know if they fixed that glitch in SAS 9.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stopping-SAS-program-if-an-error-occurs/m-p/53555#M14807</guid>
      <dc:creator>DMartin</dc:creator>
      <dc:date>2012-02-16T13:05:46Z</dc:date>
    </item>
  </channel>
</rss>

