<?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 Stop programs if error occurs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449001#M283540</link>
    <description>&lt;P&gt;Hi I was hoping if someone could help me, I have inheritted a process from one of my colleagues that has now left the business, I have to run a program on a monthly basis. this program is a mixture of Data Steps and Proc SQL code and usually takes about 8 hours to complete. Sometimes errors occur and is recorded in the log, when this happens i have to re-run the whole program again. Is there anyway that I can make SAS stop running the program when an error occurs so i can restart it from the point of failure. Your help in this matter would be much appreciated&lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 14:52:18 GMT</pubDate>
    <dc:creator>zdassu</dc:creator>
    <dc:date>2018-03-27T14:52:18Z</dc:date>
    <item>
      <title>Stop programs if error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449001#M283540</link>
      <description>&lt;P&gt;Hi I was hoping if someone could help me, I have inheritted a process from one of my colleagues that has now left the business, I have to run a program on a monthly basis. this program is a mixture of Data Steps and Proc SQL code and usually takes about 8 hours to complete. Sometimes errors occur and is recorded in the log, when this happens i have to re-run the whole program again. Is there anyway that I can make SAS stop running the program when an error occurs so i can restart it from the point of failure. Your help in this matter would be much appreciated&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 14:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449001#M283540</guid>
      <dc:creator>zdassu</dc:creator>
      <dc:date>2018-03-27T14:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Stop programs if error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449007#M283541</link>
      <description>&lt;P&gt;Dissect the code into smaller pieces that are run by the scheduler in succession; make them dependent, so that a job can only start when the previous job ended successfully.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449007#M283541</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-27T15:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Stop programs if error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449009#M283542</link>
      <description>&lt;P&gt;One of the options would be to set the system option ERRORABEND.&lt;/P&gt;
&lt;P&gt;You could add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Options errorabend;&lt;/P&gt;
&lt;P&gt;at the start of the program.&lt;/P&gt;
&lt;P&gt;From the documentation:&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;&lt;FONT style="background-color: rgb(252, 222, 192);"&gt;ERRORABEND&lt;/FONT&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;specifies that SAS terminate for most errors (including syntax errors and file not found errors) that would normally cause it to issue an error message, set OBS=0, and go into syntax-check mode (if syntax checking is enabled). SAS also terminates if an error occurs in any global statement other than the LIBNAME and FILENAME statements.&lt;/P&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryTip"&gt;Tip&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;Use the &lt;FONT style="background-color: rgb(252, 222, 192);"&gt;ERRORABEND&lt;/FONT&gt; system option with SAS production programs, which presumably should not encounter any errors. If errors are encountered and &lt;FONT style="background-color: rgb(252, 222, 192);"&gt;ERRORABEND&lt;/FONT&gt; is in effect, SAS brings the errors to your attention immediately by terminating. &lt;FONT style="background-color: rgb(252, 222, 192);"&gt;ERRORABEND&lt;/FONT&gt; does not affect how SAS handles notes such as invalid data messages.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-argDescriptionPair" id="p1001quixnuxl8n1nu5hp9up8je2"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-argDescriptionPair"&gt;This option may work better in a batch job where the log is preserved.&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449009#M283542</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-27T15:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Stop programs if error occurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449013#M283543</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59173"&gt;@zdassu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi I was hoping if someone could help me, I have inheritted a process from one of my colleagues that has now left the business, I have to run a program on a monthly basis. this program is a mixture of Data Steps and Proc SQL code and usually takes about 8 hours to complete. Sometimes errors occur and is recorded in the log, when this happens i have to re-run the whole program again. Is there anyway that I can make SAS stop running the program when an error occurs so i can restart it from the point of failure. Your help in this matter would be much appreciated&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;8 hours Lordy! I would look to improve performance of the existing program, it is usually not very hard make&amp;nbsp;modifications that greatly improve overall performance.&amp;nbsp;&amp;nbsp;Often times a long running program is rather&amp;nbsp;naively written,&amp;nbsp;ADAM.ADLB in Pharma for example.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has facilities for checkpoint restarting but I have no experience&amp;nbsp;using those.&amp;nbsp; It would be nice if someone from SAS or other user could provide an example, or reference to paper or blog post.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-programs-if-error-occurs/m-p/449013#M283543</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-03-27T15:16:49Z</dc:date>
    </item>
  </channel>
</rss>

