• Subject: Eval Exception Error Trapping
  • From: Joe Giusto <JGiusto@xxxxxxxxxxxx>
  • Date: Thu, 22 Jul 1999 17:09:13 -0400

I recently got an error on the EVAL statement "The target for a numeric
operation is too small to hold the result (C G D F)."

I know what the problem is and have corrected it by increasing the field
size.  Luckily I was available when the error occurred and was able to
re-run the procedure.  

My question is:  Is there any way to trap for this error in the RPG program?
I have read in the manuals that the exception error will occur when the
result is too big to fit into the variable. But no where did I find anything
telling me how to test for the error so that I could do some other
processing and the program will not bomb in production.  In this case, it
was a percentage of change calculation and I would put something on the
report to indicate that the calculation could not be made.  The only idea I
can think of would be to use a very large working variable for all my EVAL
statements and then test the work field for > the largest value that would
fit in the field that I really want to use (like on the report).  

There has to be a better way.  Any suggestions would be appreciated.

Thank you,

Joe Giusto II
Patuxent Publishing Company
 <mailto:jgiusto@patuxent.com> mailto:JGiusto@patuxent.com
http://www.lifegoeson.com <http://lifegoeson.com> 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].