× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: [Re: RPGILE V4.3 Gotcha]
  • From: boldt@xxxxxxxxxx
  • Date: Mon, 4 Oct 1999 15:45:33 -0400



Joel wrote:
>Have you looked at the manual on precision for intermediate results for
>eval?  The default precision will often produce downright odd results.  You
>can use EXPROPTS(*RESDECPOS) in an H spec to make all  intermediate results
>in expression evaluation have the same precision as the result field, or use
>the "r" operation extender with eval.  The manual gives some interesting
>cautions including that the result of the expression may only be a packed
>field.

"...the result of the expression may only be a packed field."???
Where does it say that in the manual?

I thought the manual said that *RESDECPOS only applies to decimal
operations.  *RESDECPOS is a solution for a problem that occurs
only for decimal numerics, and not for the other numeric data
types.

BTW, in RPG III programming, you probably used packed the most
since it had the best performance of all numeric data types.
But in ILE RPG IV, best numeric performance is achieved using
integer and unsigned data types.  So, use packed decimal only
when you actually have digits to the right of the decimal point.

>
>The default precision rule is designed to guard against overflow.  Of
>course, we always do that in programming and data base design anyway. <g>
>I've fooled around with the precision stuff some, and have had pretty good
>results with the "r".  Personally, I'd rather that "r" were the default, and
>try to guard against overflow myself.

RPG will still tell you when your expressions overflow.  There
just might be a greater possibility of it with *RESDECPOS.

Also, as I've stated before, it's still not a complete solution
since it doesn't apply for expressions that have no associated
result, such as conditional expressions.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 thread ...


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

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.