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



Tom wrote:
>Well:
>
>D PBcontrol     E DS                  ExtName(PBSCONTROL) Prefix(da_)
>D                                     DtaAra(PBACONTROL)
>...
>In *Lock PBcontrol;
>da_Sequence = da_Sequence + 1;
>Out PBcontrol;
>pa_Sequence = da_Sequence;
>...
>
>Where Sequence is a 7 digit number that used to, and still should, just
roll
>over at hival.  (This is just one example of many sequence numbers)

Oh I fully realize there may be one or two reasonable applications
for numeric truncation.  And this may well be one of them.  But is
it worth all the bugs that may be masked?  As others have pointed
out, do you really want to risk seeing $2.34 on your paycheque when
it should be $1002.34?  Or leave out high-order digits on customer
bills?  (Hmmm...)  In this case, coding a MONITOR group around the
EVAL is a small price to pay, and doesn't even cost anything in
terms of run-time performance.

And if we provided an option to mask the overflow exception, how
many people would just blindly code the option without fully
analyzing the real problem?

(I was going to suggest using a SEQUENCE in SQL for this kind of
functionality, but I'm not sure SQL on OS/400 has that particular
extension.)

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.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.