|
Chris, The error comes from using an EVAL math calculation that ends up being larger than the result field is defined. Example. Field1 (5.2) = 5412.58 Field2 (5.2) = 12589.12 Field3 (6.2) EVAL Field3 = (field1 * field2) (results in 68,139,619.1296), this number is too large to be put into field3, thus you get a numeric overflow. Using the H-spec keyword or the (R) extender only applies to the compiler holding onto the decimal places during the calculation. You need to specify field3 as a (10.2) to hold the maximum possible result. You also can get this by trying to EVAL a number that has more whole number digits than the result. Example, EVAL field1 = field3 (assuming field3 has the previous result). Thank you, Matt Tyler WinCo Foods, Inc mattt@xxxxxxxxxxxxxx -----Original Message----- From: Chris Beck [mailto:CBeck@xxxxxxxxxxxx] Sent: Wednesday, February 19, 2003 11:38 To: rpg400-l@xxxxxxxxxxxx Subject: The target for a numeric operation is too small to hold the result Does anyone know of a utility that will check your programs to see if this error could happen? Thank, Chris Beck _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.