Issue with ABS and MOD Function in Parallel Extender Job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post 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.
pratheeksha
Participant
Posts: 6
Joined: Wed Feb 27, 2013 1:02 am

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

Post 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.
Pratheeksha
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply