×
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.
Almost seems like a compiler issue because below works fine.
PositiveValue = 3;
NegativeValue = 21;
NegativeValue = PositiveValue - NegativeValue;
"Koester, Michael" <mkoester@xxxxxxxxxxxxx> wrote in message
news:mailman.2185.1285617904.2702.rpg400-l@xxxxxxxxxxxxxxx
I have a variable defined "3i 0", local to a subprocedure that I expect
could be any whole number value from -128 to +127, per my understanding
of a signed integer. When my subprocedure puts what I expect to be a
minus 18 into the field, I get the dreaded "MCH1216 - too small to hold
result" crash & burn.
I'm sure I can fix it instantly by defining packed numerics, but I need
to understand the rules.
D PositiveValue 3u 0
D NegativeValue 3i 0
/free
PositiveValue = 3;
NegativeValue = PositiveValue - 21;
[down in flames we go]
/end-free
What could be so tough about subtracting 3 from 21 and expecting -18?
Please set me straight here. It's an SQLRPGLE program on a 6.1 box.
Many thanks.
Michael Koester
As an Amazon Associate we earn from qualifying purchases.
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.