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



On Fri, Jun 9, 2017 at 11:52 AM, Wells, Joe J <jwells@xxxxxxxxx> wrote:
See the problem? POS1 is wrong because it only is only 1 position. The values are getting truncated and SCAN is not throwing an error.

POS2 is correct. It has 2 positions.

Has anyone seen this before?

I don't mean to be snide, but practically everyone who has worked with
RPG of a certain age (and that age could refer to the programmer or to
the RPG code!) has seen this. It's a basic and fundamental way in
which RPG works, prior to the introduction of EVAL. "Classic" RPG
arithmetic almost never overflows, it just truncates on the
extremities furthest from the decimal point. (And I say "almost never"
only because I am too lazy to exhaustively rule out every situation.)
Try doing a DO loop from 1 to 100 where the loop counter has only 2
digits.

John Y.

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.