|
Thanks for your reply Dennis
as I replied to Joep
I'm still scratching my head
The field
d Bxwegt s 5 inz('01800')
Is really the value 18.00
I changed the code to
D Bywegt s 7p 2
with the same result RNX0103
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
"Dennis Lovelady"
<iseries@lovelady
.com>
To
Sent by: "'RPG programming on the IBM i /
rpg400-l-bounces@ System i'" <rpg400-
l@xxxxxxxxxxxx>
midrange.com
cc
Subject
11/10/2010 08:42 RE: I thought I knew how %dec
AM worked
Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>
I believe you are trying to put 1800.00 into a field that cannot hold a
value greater than 999.99.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Guidelines for Bureaucrats:
(1) When in charge ponder.
(2) When in trouble delegate.
(3) When in doubt mumble."
-- James H. Boren
Like the subject says, I thought I knew how %dec worked Here is my99
code
d Bxwegt s 5 inz('01800')
D Bywegt s 5p 2
*-------------------------------------------------
* Stand Alone Fields - BOTTOM
*-------------------------------------------------
**************************************************
/FREE
Bywegt = %dec(Bxwegt: 5: 2);
*inlr = '1';
return;
/END-FREE
Pretty simple and straight forward, but when I run this, I get the
following error message
Message ID . . . . . . : RNX0103 Severity . . . . . . . :
Message type . . . . . : Diagnosticto
Date sent . . . . . . : 11/10/10 Time sent . . . . . . :
13:00:14
Message . . . . : The target for a numeric operation is too small
hold
the result.
Cause . . . . . : An arithmetic operation resulted in a value which
is
too
large to fit in the target. If this is a numeric expression, the
overflow
could be the result of the calculation of some intermediate result.
Recovery . . . : Either make the target of the operation larger or,
if
in
an expression, choose the precision of the operands in the
expression so
that intermediate value will fit into the intermediate result.
I increased the field Bywegt to 6p 2, with the same result
Am I missing something?
Oh, before I forget (like I almost ALWAYS do) we are at V5r4
As always, any and all answers MUCH appreciated
--
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-2025 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.