I scanned the Intertubes (and this list, of course) and I didn't find anything that exactly matched my question, so I thought I'd bring it to the group.

When I write new programs, I can pretty easily program for overflow and I in fact do it.  %MAX and %MIN will help even more for just that sort of thing.  But when I'm converting legacy RPG/400 programs it's not quite as simple.  A program can have hundreds of individual math operations, and if I were to put a monitor around each one, I'd end up with a huge and less readable program.

Yes, over time I can isolate and combine mathematics into expressions, but that's more of an analysis task than a mechanical conversion, and often I can justify the latter but not the former in terms of time spent.

So I'm wondering, what is everyone else doing when converting RPG/400?  It kind of boiled down to this for me:

1. Just convert and let it hard-halt on overflow
2. Put a monitor block around every overflow-capable operation
3. Put monitors around large blocks of code

Number 1 is easy and errors will definitely get attention. Number 2 allows me to put special overflow values into individual fields but the syntactic overhead is pretty large (every computation becomes five lines, more if you log errors).  Number 3 is something that seems reasonable as long as I can gracefully terminate the transaction and put it in a state to be recovered.

I just don't have a good feel for the best solution, but I'm in the process of converting a program that gets called by dozens of other programs in every job stream, so it's probably a good time to do it correctly.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.