Page 1 of 1

Looping or Iteration based on codes

Posted: Wed Oct 18, 2017 12:25 am
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

Posted: Wed Oct 18, 2017 7:13 am
by chulett
What have you tried? What issues are you facing? Looks like a pretty straight-forward "transformer looping" scenario to me...

Posted: Wed Oct 18, 2017 11:34 pm
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.