|
Sudha wrote: >While using EVAL for computing numbers, if the result of >computing gets larger than the result field definition, the >throws up an error. Is there any way to get around this? >Like say truncate (as it does in Move) some EVAL(T)?? :) >If I use *PSSR, the program goes to the top of the line and >I loose all the work that is done till then. (Right now, am >using a very large number for computation and comparing that >with *hival of the defined number and then if larger, moving >hival! Would prefer a much smarter way to do this.) The way to get around this is to fix the bug in your expression that gives you the numeric overflow exception. Although using the fixed format arithmetic ops with decimal numeric operands will (by default) truncate results, for numeric expressions, the behavior is much more complicated and truncation (if allowed) would more often yield results that you did not expect. BTW, moving *HIVAL into a field is NOT the same as truncating a result. Also, I hope that when you put *HIVAL into the field, you treat that as some special value and not as the actual result of the computation. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.