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



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
>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?

And, other than lines of code, the monitor group differs from the opcode
extension how?  It can be misused as well.  As we say about our users "you
can't make a system foolproof because fools are too ingenious" you can also
say about your users.

Eval(e) is an ease of use thing on r510, it's a necessity on r450 and below.
Somehow the program needs to handle the 9,999,999 good transactions without
needing to check for the one bad one.

-----Original Message-----
From: boldt@ca.ibm.com [mailto:boldt@ca.ibm.com]
Sent: Thursday, December 06, 2001 11:55 AM
To: rpg400-l@midrange.com
Subject: Re: Target for numeric operation too small...hello, Toronto?


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

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


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.