|
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
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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 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.