× 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.



Dave,

As per my V5R3 RPGLE Reference Maunual, under "Arithmetic Operations":


***********
In general, arithmetic operations are performed using the packed-decimal
format. This means that the fields are first converted to packed-decimal
format prior to performing the arithmetic operation, and then converted
back to their specified format (if necessary) prior to placing the result
in the result field.

However, note the following exceptions:
– If all operands are unsigned, the operation will use unsigned arithmetic.
– If all are integer, or integer and unsigned, then the operation will use
integer arithmetic.
– If any operands are float, then the remaining operands are converted to
float.
***********
%SUDBT returns an unsigned numeric value, so, in your code, if the result
is negative, it should give an error... (I hope that the = after the IF
must be a typo...)

Best Regards,


Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.