<?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 SAS program to stop execute or abort if there is a WARNING in the first step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532505#M145921</link>
    <description>&lt;P&gt;I've 5 data steps. If I execute and if there is a WARNING in the first step, I do not want the other steps to execute. Is there a way to achieve this?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Feb 2019 06:00:06 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2019-02-04T06:00:06Z</dc:date>
    <item>
      <title>SAS program to stop execute or abort if there is a WARNING in the first step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532505#M145921</link>
      <description>&lt;P&gt;I've 5 data steps. If I execute and if there is a WARNING in the first step, I do not want the other steps to execute. Is there a way to achieve this?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 06:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532505#M145921</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-02-04T06:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to stop execute or abort if there is a WARNING in the first step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532512#M145925</link>
      <description>&lt;P&gt;The easiest way is to check the SYSCC automatic macro variable. This variables has two advantages:&lt;/P&gt;
&lt;OL style="list-style-position: inside;"&gt;
&lt;LI&gt;You can set it&lt;/LI&gt;
&lt;LI&gt;It shows the maximum error or warning code since you set it:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let SYSCC=0;

Data x; 
/*  this is your first data step */
run;

data _null_;
  if &amp;amp;syscc then abort cancel file;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used the CANCEL FILE version of the ABORT statement, as this will not terminate your SAS session if you are testing in oline SAS.&lt;/P&gt;
&lt;P&gt;If you only want to exit on errors, you should check for SYSCC&amp;gt;4, 1 to 4 are warnings.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 07:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532512#M145925</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-02-04T07:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to stop execute or abort if there is a WARNING in the first step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532568#M145940</link>
      <description>&lt;P&gt;The question should really be, why does the datastep cause errors/warnings?&amp;nbsp; First off, a warning may not fail the following steps, that is a key difference between warning and error.&amp;nbsp; Second, you should be coding "in a defensive manner".&amp;nbsp; What this means is pre-empting and handling issues, if code is throwing errors/warnings later on and your input hasn't changed (as it wont as you will have an import agreement/import process), then the code was not correctly coded first time.&amp;nbsp; Proper testing and robust coding will avoid these issues.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 14:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-to-stop-execute-or-abort-if-there-is-a-WARNING-in/m-p/532568#M145940</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-04T14:33:09Z</dc:date>
    </item>
  </channel>
</rss>

