Hi,
Initially my problem was with arithmetic operations of number with larger singinifcant number of digits, but this was solved by using string mathematics functions.
But now, I also need to use FIX function to round of to 2 digits.
eg. Original Function: FIX(Input.FOREIGN_AMOUNT*(Input.RATE_MULT/Input.RATE_DIV),2,0) and after switching to String maths, the function is FIX(SMUL(Input.AMT,SDIV(Input.RATE_DID,Input.RATE_MULT)),2,0)
Now, using SMUL and SDIV have solved my problem of handling large numbes, but FIX is becoming a bottleneck, as it is rounding off the digits after 16th position. I have changed EXACTNUMERIC to variuos values say, 28, 36 and 57, but no change !!
The stes follwed for changing the EXACTNUMERIC were:
1. Logoff all users from DS
2. Edit uvconfig, and change EXACTNUMERIC to a new value
3. uvregen
4. Restart DS
5. uvregen -t ( It reflects the changes being applied)
Please advice
EXACTNUMERIC and Rounding of Digits
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
EXACTNUMERIC and Rounding of Digits
Share to Learn, and Learn to Share.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
the second argument specifies the PRECISION and the third argument specifies whether rounding has to happen or truncation.
In my case I need to round off to the second decimal position, but in case the number is big enough, eg.
Input
Output:
The expected Output is 13791208901250452834020.19
Currently I am achieving this by using SDIV(SMUL(Amt,RateMult),RateDiv,2)
And my problem is that why FIX is unable to handle this big number ?
In my case I need to round off to the second decimal position, but in case the number is big enough, eg.
Input
Code: Select all
AMT = 12345678901234567890123.123
RATE_MULT = 1.25500001
RATE_DIV = 1.12345678
Code: Select all
FIX(Input.AMT*(Input.RATE_MULT/Input.RATE_DIV),2,0) = 13791208901250500000000
FIX(SMUL(Input.AMT,SDIV(Input.RATE_DID,Input.RATE_MULT)),2,0) = 13791208901250400000000
The expected Output is 13791208901250452834020.19
Currently I am achieving this by using SDIV(SMUL(Amt,RateMult),RateDiv,2)
And my problem is that why FIX is unable to handle this big number ?
Share to Learn, and Learn to Share.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I suspect that that's just the way Fix() is. There's nothing obvious in the documentation (the DataStage BASIC manual). You could always use Fmt() or Oconv() to do your rounding.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto