895 pts.
 decimal data error
I declare time field in RPG as

D btime    4  0

eval btime = 2400

this one i pass to a CL program with var type

var(&tim) type(*dec) len(4,0)

and this in turn passed to another RPG program

D stime    4  0

when it comes to third program it has some hex char shown in debug as belo

stime = 2_4_

i have no clue how this hex char comes in to picture..

and when i try to move this to another numeric field it throws decimal data errro

Please help



Software/Hardware used:
as400
ASKED: October 20, 2009  10:29 PM
UPDATED: October 21, 2009  1:07 PM

Answer Wiki:
If this is really how you define it in RPG: <pre> D btime 4 0 </pre> Then this is incorrect in CL: <pre> var(&tim) type(*dec) len(4,0) </pre> One or the other is wrong. The two types are not the same -- it's zoned-decimal in RPG and packed-decimal in CL. The RPG is zoned-decimal because you did not specify a data type and it's not a stand-alone field; it's a data structure subfield. Give it a data type of 'P' in RPG, or make it a stand-alone field, or change it to CHAR (4) in CL. If you change the RPG, change both places. Tom
Last Wiki Answer Submitted:  October 21, 2009  1:45 am  by  TomLiotta   108,055 pts.
All Answer Wiki Contributors:  TomLiotta   108,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _