BookmarkSubscribeRSS Feed
torstenmeb
Calcite | Level 5

Hello,

 

I'm running a loop macro through many >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):

 

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

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.

%macro analysis(catnum);

ods output parameterestimates=pedes_&catnum;
proc phreg data=output_&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>0 or %SYSERR>0 or %error>0 or  %length(%SYSERRORTEXT)>0 %then %goto continue; 

%continue:
ods output parameterestimates=pedes_&catnum;
proc phreg data=output_&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=&start %to &stop;
%analysis(&iii);
%end;
%mend;

Any idea howto overcome this abortion error to continue the loop cycle?

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. 

 

(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).

 

Thanks!

 

(SAS 9.4 TS Level 1M4)

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I don't know about the error, I will move the post to stats proc area as some statistician maybe able to help.

 

What I would ask is why you are doing the whole looping and creating datasets?  Its almost never an idea to split data up.  Use by group processing.  In this instance:

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;

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.  It will be quicker than running separately, avoid messy macro code, and reduce disk space.

torstenmeb
Calcite | Level 5
Thanks for the reply!
Because of various reasons (one reason, >10Tb dataset) I must split the data instead of using by statement.
The loop macro performs many other steps but I've removed everything that isn't necessary to display here.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1742 views
  • 0 likes
  • 2 in conversation