Logoc Question - Looping

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Logoc Question - Looping

Post by Raftsman »

I have a requirement to produce multiple records from one input.

i.e. ColA ColB Low High

EE AA 10 12

My requirement is to end up with the following


EE AA 10
EE AA 11
EE AA 12

For each input I must create multiple records that fall between the low and high of the input record. I tried using a range lookup but I can't seem to figure out how to add to my counter.

Has anyone designed logic using DS or must I create a BuildOp

Thanks in advance
Jim Stewart
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

well, a routine can return you comma seperated numbers like
input 10 and 12 -> 10,11,12
and then pivot stage will do the rest.

Just a thought.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

After reviewing the task, I created a Temp file that contains all sequence numbers between 1 and 20. Using this, I do a range lookup comparing the values between the low and high, funnel the records back into the stream and I get my result.

It's not pretty but it works.

Thanks
Jim Stewart
Post Reply