Move the byte position

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

Post Reply
consulting
Participant
Posts: 50
Joined: Fri Dec 21, 2007 3:24 am

Move the byte position

Post by consulting »

Hi
In my requirement I am finding a feild called XXX which is of 24 byte varchar, It is calculated from the column X which is of 1 byte.

The logic for XXX Concatenated value of 24 months X with latest month being the 1st byte

ie. during very first month run the value in XXX is 00000000000000000000000 (24 zeros)
suppose the value of X is calulated as 1 then XXX should be 1000000000000000000 (x:23zero)
During second month if the value of X is calculated as 2 then XXX should be 21000000000000000000000 (here first byte moved to second byte newly found value in 1 byte)
During third month if the value of X is calculated as 3 then XXX should be 32100000000000000000000 (second byte moved to third,first byte moved to second ,newlt found to 1 byte)
During fourth month if the value of X is calculated as 4 then XXX should be 432100000000000000000000 like this(newly found in first byte,first byte to second byte,second byte to third,third byte to fourth....)

like this when every month is run the recent byte X should be in first position so the first position should be shifted to second second is shifted to third should shift to fourth like this it follows


Thanks
balaji
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You were given a solution for the 12-month case. Simply generalize that.

And please delete your duplicate post before anyone responds to it.
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