Your SAS programs, embedded in web apps and elsewhere

End Program After Floating Point Overflow Error

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

End Program After Floating Point Overflow Error

Good morning,

 

I am currently using SAS Enterprise Guide 5.1 on a Windows 7 operating system and I am currently dealing with floating point overflow errors.

 

I am working on a stored process and occassionally encounter floating point overflow errors.  I have been looking for a way to end the stored process, or call another stored process, if a floating point overflow error is thrown and display a message that the program failed to complete.  I am looking to have something other than the Stored Process Error Log being shown because other people will be using this program in the future.

 

The floating point overflow error is appearing during an iteration of PROC NLIN.

 

 

proc nlin data=&dataset nohalve maxiter=20000;
		parms b1=&B1_x b2=&B2_x J=&J_x;
		model var=b1*(b2+mean)**J;
		resid=model.var;
		_weight_=(n-1)/(resid**2);
		ods exclude all;
		ods output ParameterEstimates=FINAL_&dataset;
	run;quit;

 

FPOE.jpg

 

I'm wondering if there is a way to have the program stop and either print a message on the screen, or call another stored process which, in turn, would display a message the program failed to complete.

 

I have tried using the macro variable &SYSERR, but that doesn't work because the NLIN fails to complete so the &SYSERR can't be checked to see if there were errors.

 

Are there any other methods of error trapping that I could use with NLIN to catch the floating point overflow error and have control on how the error is expressed?

 

Thank you.

 

 


Accepted Solutions
Solution
‎01-11-2016 09:17 AM
Community Manager
Posts: 2,955

Re: End Program After Floating Point Overflow Error

Posted in reply to bharathkumar

Good advice about checking the data set length.

 

If the NLIN step consistently throws a floating point exception in certain conditions, you might want to work with SAS Tech Support to see if there is anything you can do to trap that condition (or avoid it) when it occurs.  Or check to see if it's a known problem with NLIN (assuming with EG 5.1 you might be using SAS 9.3 and SAS/STAT 12.1?) -- perhaps there is a fix.

View solution in original post


All Replies
Occasional Contributor
Posts: 6

Re: End Program After Floating Point Overflow Error

Posted in reply to chris_lampron

Hi Chris,

 

I don't know much about "proc nlin" process, But I will give you suggestion It may work.

 

If the proc nlin procedure fails then "Final_&dataset" having "0"  obesrvations, so based on final dataset we can trap TRAP the error.

If the dataset have more than one observation your program is successful else fail... 

 

Let me know if you have any questions or Correct If  I am wrong.

 

Regards,

Bharath

 

 

 

 

 

 

Solution
‎01-11-2016 09:17 AM
Community Manager
Posts: 2,955

Re: End Program After Floating Point Overflow Error

Posted in reply to bharathkumar

Good advice about checking the data set length.

 

If the NLIN step consistently throws a floating point exception in certain conditions, you might want to work with SAS Tech Support to see if there is anything you can do to trap that condition (or avoid it) when it occurs.  Or check to see if it's a known problem with NLIN (assuming with EG 5.1 you might be using SAS 9.3 and SAS/STAT 12.1?) -- perhaps there is a fix.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 371 views
  • 2 likes
  • 3 in conversation