<?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 handling, Floating point exception termination in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539572#M27089</link>
    <description>&lt;P&gt;I don't know about the error, I will move the post to stats proc area as some statistician maybe able to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would ask is why you are doing the whole looping and creating datasets?&amp;nbsp; Its almost never an idea to split data up.&amp;nbsp; Use by group processing.&amp;nbsp; In this instance:&lt;/P&gt;
&lt;PRE&gt;ods output parameterestimates=pedes;

proc phreg data=output;
  strata yearentry origin;
  class catnum sex;
  effect aspl=spline(age / naturalcubic knotmethod=equal(5));
  effect tspl=spline(num / naturalcubic knotmethod=list(1,3,5,10,20,50,100,150));
  model (entry,exit)*censored(1)= max_des sex  aspl tspl ;
run;&lt;/PRE&gt;
&lt;P&gt;Would be the way to code it (just guessing here as can't run anything or test), so add catnum to class list, then you will get one larger dataset with all the output together.&amp;nbsp; It will be quicker than running separately, avoid messy macro code, and reduce disk space.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 10:17:52 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-03-01T10:17:52Z</dc:date>
    <item>
      <title>Error handling, Floating point exception termination</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539571#M27088</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running a loop macro through many &amp;gt;5000 datasets using proc phreg with the fast option.However, some datasets fail generating the Floating Point Exception and Domain Error which I cannot seem to get around (I have looked at these data and cannot find the reason for them failing):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Domain error.
WARNING: Output 'parameterestimates' was not created.  Make sure that the output object name, label,
         or path is spelled correctly.  Also, verify that the appropriate procedure options are used
         to produce the requested output object.  For example, verify that the NOPRINT option is not
         used.
ERROR: Termination due to Floating Point Exception
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The PROCEDURE PHREG printed page 1558.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           23.74 seconds
      cpu time            23.73 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Running the same datasets without the fast option works. Thus my solution would be to tell the macro to continue if error and redo the analysis removing the fast option for the failing datasets. However, the termination above causes a total abort and the %SYSERR handling I've implemented has no effect, the termination is final. NOERRORABEND is true.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro analysis(catnum);

ods output parameterestimates=pedes_&amp;amp;catnum;
proc phreg data=output_&amp;amp;catnum fast;
strata yearentry origin;
class sex ;
effect aspl=spline(age / naturalcubic knotmethod=equal(5));
effect tspl=spline(num / naturalcubic knotmethod=list(1,3,5,10,20,50,100,150));
model (entry,exit)*censored(1)= max_des sex  aspl tspl ;
run;
%if %SYSCC&amp;gt;0 or %SYSERR&amp;gt;0 or %error&amp;gt;0 or  %length(%SYSERRORTEXT)&amp;gt;0 %then %goto continue; 

%continue:
ods output parameterestimates=pedes_&amp;amp;catnum;
proc phreg data=output_&amp;amp;catnum;
strata yearentry origin;
class sex ;
effect aspl=spline(age/ naturalcubic knotmethod=equal(5));
effect tspl=spline(num / naturalcubic knotmethod=list(1,3,5,10,20,50,100,150));
model (entry,exit)*censored(1)= max_des sex  aspl tspl ;
run;

%mend;

Loop macro:


%macro loop(start,stop);
%do iii=&amp;amp;start %to &amp;amp;stop;
%analysis(&amp;amp;iii);
%end;
%mend;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any idea&amp;nbsp;howto overcome this abortion error to continue the loop cycle?&lt;/P&gt;&lt;P&gt;Another OK, solution would be to just continue the loop macro but from i+1, then I could check the error and cycle through only the error sets without the fast option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Aggregating the data to a few sets and running the analysis using a by statement produces the same failures in the same datasets, I've checked for missing records and rounded entry and exit etc without success).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(SAS 9.4 TS Level 1M4)&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 10:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539571#M27088</guid>
      <dc:creator>torstenmeb</dc:creator>
      <dc:date>2019-03-01T10:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling, Floating point exception termination</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539572#M27089</link>
      <description>&lt;P&gt;I don't know about the error, I will move the post to stats proc area as some statistician maybe able to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would ask is why you are doing the whole looping and creating datasets?&amp;nbsp; Its almost never an idea to split data up.&amp;nbsp; Use by group processing.&amp;nbsp; In this instance:&lt;/P&gt;
&lt;PRE&gt;ods output parameterestimates=pedes;

proc phreg data=output;
  strata yearentry origin;
  class catnum sex;
  effect aspl=spline(age / naturalcubic knotmethod=equal(5));
  effect tspl=spline(num / naturalcubic knotmethod=list(1,3,5,10,20,50,100,150));
  model (entry,exit)*censored(1)= max_des sex  aspl tspl ;
run;&lt;/PRE&gt;
&lt;P&gt;Would be the way to code it (just guessing here as can't run anything or test), so add catnum to class list, then you will get one larger dataset with all the output together.&amp;nbsp; It will be quicker than running separately, avoid messy macro code, and reduce disk space.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 10:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539572#M27089</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-01T10:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling, Floating point exception termination</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539575#M27090</link>
      <description>Thanks for the reply!&lt;BR /&gt;Because of various reasons (one reason, &amp;gt;10Tb dataset) I must split the data instead of using by statement.&lt;BR /&gt;The loop macro performs many other steps but I've removed everything that isn't necessary to display here.&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Mar 2019 10:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-handling-Floating-point-exception-termination/m-p/539575#M27090</guid>
      <dc:creator>torstenmeb</dc:creator>
      <dc:date>2019-03-01T10:26:15Z</dc:date>
    </item>
  </channel>
</rss>

