Looping or Iteration based on codes

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
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Looping or Iteration based on codes

Post by jpraveen »

I have a requirement to generate the same set of records based on codes & input data.

my input data looks like

John|101|M|23
Kathy|102|F|40
Jean|103|M|23
Pauk|104|M|55

I have standard codes US,GB,MX,CA

and the output should be

John|101|M|23|US
John|101|M|23|GB
John|101|M|23|MX
John|101|M|23|CA
Kathy|102|F|40|US
Kathy|102|F|40|GM
Kathy|102|F|40|MX
Kathy|102|F|40|CA
Jean|103|M|23|US
Jean|103|M|23|GB
Jean|103|M|23|MX
Jean|103|M|23|CA
Paul|104|M|55|US
Paul|104|M|55|GB
Paul|104|M|55|MX
Paul|104|M|55|CA
Jaypee
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What have you tried? What issues are you facing? Looks like a pretty straight-forward "transformer looping" scenario to me...
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Agreed, very easily accomplished using a Transformer looping through a list of state abbreviations with which you probably initialize a stage variable.

I assume the GM was a typo, that the list is the same for all input records. If not, some extra complexity needs to be introduced, but the task likely remains doable.
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