<?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: error checking in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119248#M24550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking to send records with errors to a separate data set within a data step? It will depend on the types of 'error' encountered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an automatic variable _ERROR_ in data vector that SAS will set to 1 for most error conditions. You can direct those records to a separate data set with code similar to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data NormalProcess Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt; &amp;lt;program statements&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _error_= 1 then output Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else output NormalProcess;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2013 14:40:04 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-08-22T14:40:04Z</dc:date>
    <item>
      <title>error checking</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119247#M24549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible in any case that sas can write out recrds to ouput dataset even with errors (any kind of errors) in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking of checking errors by looking at obs &amp;gt; 0 in the final data set. Is there any potential issues with this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 14:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119247#M24549</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2013-08-22T14:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: error checking</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119248#M24550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking to send records with errors to a separate data set within a data step? It will depend on the types of 'error' encountered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an automatic variable _ERROR_ in data vector that SAS will set to 1 for most error conditions. You can direct those records to a separate data set with code similar to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data NormalProcess Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt; &amp;lt;program statements&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _error_= 1 then output Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else output NormalProcess;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 14:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119248#M24550</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-22T14:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: error checking</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119249#M24551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two potential issues off the top of my head.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the logic of that final DATA step may output zero observations, even if there are no errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, what if the final DATA step replaces an existing data set?&amp;nbsp; The final step might contain errors, yet the existing data set would not be replaced because of the errors.&amp;nbsp; When you check for the number of observations, you will find that observations exist because they were already there before the error-filled DATA step began.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 16:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119249#M24551</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-08-22T16:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: error checking</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119250#M24552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 17:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119250#M24552</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2013-08-22T17:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: error checking</title>
      <link>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119251#M24553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I you want to exclude the possibility of a program or executing error by checking the condition this way it is rather tricky.&lt;/P&gt;&lt;P&gt;Reasons:&lt;/P&gt;&lt;P&gt;- The last processing code need not to be something creating a dataset. Coud be a report processing&lt;/P&gt;&lt;P&gt;- Creating a dataset with 0 record can be the signal of a good processed flow when this dataset is the collection of error records&lt;/P&gt;&lt;P&gt;- When generating reports or flatfiles you are creating not sas-datasets but something else.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS has many ways to validate the processing. The macro sysrc serves as condition code to the OS.&lt;/P&gt;&lt;P&gt;Even that way of checking is not 99,9% reliable. Sometimes you do not get any feedback or it an bug in errorchecking.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Please can you explain your situation environment and what you are trying to achieve?.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 17:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/error-checking/m-p/119251#M24553</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-22T17:33:15Z</dc:date>
    </item>
  </channel>
</rss>

