Page 2 of 2

Posted: Fri Apr 09, 2010 2:00 am
by ShaneMuir
anbu wrote:Modulus returns the remainder which is not mere subtraction.
I realise this, but looking back to the original posts requirements, it would appear all that is required is a substraction. Why go to all the trouble of MOD?

Unless of course the figures given in the original post were coincidentally giving the same result with a subtraction.

Re: Issue with ABS and MOD Function in Parallel Extender J

Posted: Sun May 25, 2014 10:49 pm
by pratheeksha
We can define MOD function as

MOD(m,n)= m-n*floor(m/n)

As we have Floor function available in datastage, this calculation could be done in a stage variable and the final value could be used.

Posted: Sun May 25, 2014 11:06 pm
by ray.wurlod
Mod() is, of course, an INTEGER division function, as noted by Arnd and others.

Another solution would be to increase the arguments by powers of ten until they were integer-equivalents, then reduce back afterwards.

But why re-open this thread four years on?