<?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: reaction to error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88561#M25276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once upon a time I did something similar. The general idea was to write a macro that would check the status after each datastep/ procedure boundary.&lt;/P&gt;&lt;P&gt;I would recommend that instead of saving to a macro variable alone to write it to a permanent dataset with some information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be some operating system dependencies, so which OS? Also is this a batch job or interactive? Macros or running in a macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My approach had been that the macro was called at each boundary that provided some information as the last datastep/ proc in the program. Then the system date and time were queried.&lt;/P&gt;&lt;P&gt;If the %SYSERR was greater than a cutoff, 4 if I remember, then the the message was retrieved from the SYSERRORTEXT system variable. All of this was appended to a log dataset. Then used the %ABORT statement to end the program. Mine was batch job running overnight so I used the ABEND option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2012 16:25:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-06-21T16:25:27Z</dc:date>
    <item>
      <title>reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88558#M25273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we run a long SAS code, errors maybe happen.and the error information would be push into SAS log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is if&amp;nbsp; an error happened how we can stop running the rest program immediately and have the error information recorded in a macro variable for the future reference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 19:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88558#M25273</guid>
      <dc:creator>Mike_Davis</dc:creator>
      <dc:date>2012-06-20T19:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88559#M25274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%put &amp;amp;syserr;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 19:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88559#M25274</guid>
      <dc:creator>Mike_Davis</dc:creator>
      <dc:date>2012-06-20T19:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88560#M25275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone has idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 12:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88560#M25275</guid>
      <dc:creator>Mike_Davis</dc:creator>
      <dc:date>2012-06-21T12:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88561#M25276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once upon a time I did something similar. The general idea was to write a macro that would check the status after each datastep/ procedure boundary.&lt;/P&gt;&lt;P&gt;I would recommend that instead of saving to a macro variable alone to write it to a permanent dataset with some information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be some operating system dependencies, so which OS? Also is this a batch job or interactive? Macros or running in a macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My approach had been that the macro was called at each boundary that provided some information as the last datastep/ proc in the program. Then the system date and time were queried.&lt;/P&gt;&lt;P&gt;If the %SYSERR was greater than a cutoff, 4 if I remember, then the the message was retrieved from the SYSERRORTEXT system variable. All of this was appended to a log dataset. Then used the %ABORT statement to end the program. Mine was batch job running overnight so I used the ABEND option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 16:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88561#M25276</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-06-21T16:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88562#M25277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever look at the SAS code gnerated by DI Studio? It uses macros to record the results of procs and data steps. Maybe that will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between steps it generates code such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %rcSet(&amp;amp;syserr); &lt;/P&gt;&lt;P&gt;%rcSet(&amp;amp;sqlrc);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this idea could be expanded for your needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 10:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88562#M25277</guid>
      <dc:creator>RobertWoodruff</dc:creator>
      <dc:date>2012-06-22T10:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: reaction to error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88563#M25278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"an error happened how we can stop running the rest program immediately "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check some system options such as abend ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"and have the error information recorded in a macro variable for the future reference?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &amp;amp;SYSERRORTEXT automatic macro variable contains the text of the last&lt;/P&gt;&lt;P&gt;error message formatted for display on the SAS log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 02:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reaction-to-error/m-p/88563#M25278</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-25T02:03:47Z</dc:date>
    </item>
  </channel>
</rss>

