Page 1 of 1

Addition operation with decimal values

PostPosted: Wed Dec 24, 2014 9:44 am
by vigneshts1
Hi Team,

I'm new to easytrieve and slowly started learning easytrieve. I have already gone through the mainframe forums but couldn't able to find it. If this question has already by someone, please don't get angry with me. I want to perform addition operation in easytrieve.

I/P File:

chris 84,230,280.37 10.27
chris 125.90 125,231,112.37
tommy 123,67.12 145.94
tommy 10.27 6,500.00

Input file layout:
1)the first column hold the position # from 1 to 15
2)Second column from 17 to 30
3)Third column from 32 to 45
4)Position # 16 and 31 is for filler(Spaces in my case)

Eg: Chris occupies the value from 1 to 15
84,230,280.37 fall in between 17 to 30
10.27 fall in between 32 to 45

I want to add 84,230,280.37 + 10.27 = 84,230,290.64. When i was trying without decimal value, i was getting A006 PROGRAM INTERRUPT - CODE 7(DATA EXCP) ERROR.
But actually i want to complete this with decimal values.

Could someone help me to accomplish this.

Thanks & Regards,
sv.

Re: Addition operation with decimal values

PostPosted: Wed Dec 24, 2014 1:57 pm
by BillyBoyo
It sounds like those editing values, the commas and decimal-points, actualy exist. You can't use that type of data directly in a calculation. You need to turn them into actual numbers.