Problem while adding large values in REXX



IBM's Command List programming language & Restructured Extended Executor

Problem while adding large values in REXX

Postby Mann_B » Fri Apr 29, 2011 12:28 pm

Hi ..

I have a requirement where I need to add amount fileds at Card Member level. If I have same CM twice then I need to sum up the amount from 2 records and I need to have single record in the o/p for that CM,
Even if they are negative I need to add those.
Amount field is of 8bytes --s9(15) comp-3
We are unpacking the values ,adding them and appending C for positive and D for negative and packing the value again.
Now am encountering a prob while adding a number.

AMOUNT1= -1299999870 --it is Negative
As it is large number its been replaced by 1.29999987E+9.

AMOUNT2= -200000130

After adding it is = -1.50000000E+9
After appending D as it is negative value is it 001.50000000E+9D

So after adding ,the frmt is stil the same and am getting error while packing that value again.
AMOUNT.CNT = (X2C(AMOUNT.CNT))
Please help me like how to get the actual value for it,,

Thank You
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: Problem while adding large values in REXX

Postby enrico-sorichetti » Fri Apr 29, 2011 12:32 pm

NUMERIC DIGITS
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Problem while adding large values in REXX

Postby Mann_B » Sat Apr 30, 2011 11:49 am

Hi enrico-sorichetti

Thank You soo much..I got the required results.
Mann_B
 
Posts: 79
Joined: Wed Mar 31, 2010 11:48 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post