Page 1 of 1

datastage 8.1 - 'loop' through a column with multiple values

Posted: Mon Feb 07, 2011 10:24 am
by new2ds2011
Datastage 8.1

i have a source table as the following

ID # of email email
---- ----------- ------
1 2 abc@abc.com, bcd@bcd.com
2 3 jfk@jfk.com, a2z@a2z.com, bbb@bbb.com

I need to make each email address a record so the data in the target table will look like this

ID email# email
---- --------- -----------
1 1 abc@abc.com
1 2 bcd@bcd.com
2 1 jfk@jfk.com
2 2 a2z@a2z.com
2 3 bbb@bbb.com


I am new to DataStage, and have been reading the 'Restructure' categories, but haven't figured out yet. Stored procedure stage would be an option, I suppose.

Thanks in advance.
new2ds

Posted: Mon Feb 07, 2011 12:02 pm
by ray.wurlod
Welcome aboard. That style of looping is available in version 8.5. In earlier versions the easiest approach is to re-parse the comma delimited field into separate fields (perhaps using Column Import stage) then Pivot.