|
Thanks Hans for your response, but I do not agree that truncation is never an acceptable result. If I am working on payroll or accounting, yes I don't want truncations to occur. But if I am working on a salesman growth percentage report and I have one salesperson with 10000 percent growth because he had two customers this month as opposed to none last month, I would rather not have to account for a much larger than expected maximum to just to handle the exceptional ridiculous number. And when you have a report running for maybe hours at a time, I could certainly accept truncation. I don't think RPG III was too kind in this regard, I think it gave the programmer control of his program. John M. Bauman Lead Programmer Ward Trucking Second Avenue & Seventh Street, Greenwood Altoona, Pa 16602 Voice: (800) 458-3625 Ext. 284 Voice Direct: (814) 947-1284 (Direct Line) Fax: (814) 944-5470 JMBauman@Wardtrucking.com Visit our website at http://www.wardtrucking.com Yes, there is a way to avoid getting the overflow exception: Fix the logic errors in your program that are causing the numeric overflows. RPG III was too "kind" in that it did not tell you when your numerics overflowed, and instead quietly truncated values. If you really do need your numerics truncated (and I really can't think of any situation where truncation might be useful and there isn't a better alternative), convert your numeric value to character using something like %EDITC(...:'X') and %SUBST the desired number of right-most characters. Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
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.