How to generate multiple rows?
Moderators: chulett, rschirm, roy
How to generate multiple rows?
Helo every one.
I have a scenario as below...
input(a FILE):
col1 col2 col3
---------------------
100 aa1 bb1
200 aa2 bb2
Output needed as (also a FILE)
col1 col2 col3 col4 col5
----------------------------
100 aa1 bb1 xx1 yy1
100 aa1 bb1 xx2 yy2
100 aa1 bb1 xx3 yy3
200 aa2 bb2 xx1 yy1
200 aa2 bb2 xx2 yy2
200 aa2 bb2 xx3 yy3
Any ideas how this can be accomplished...?
thanks in advance.
I have a scenario as below...
input(a FILE):
col1 col2 col3
---------------------
100 aa1 bb1
200 aa2 bb2
Output needed as (also a FILE)
col1 col2 col3 col4 col5
----------------------------
100 aa1 bb1 xx1 yy1
100 aa1 bb1 xx2 yy2
100 aa1 bb1 xx3 yy3
200 aa2 bb2 xx1 yy1
200 aa2 bb2 xx2 yy2
200 aa2 bb2 xx3 yy3
Any ideas how this can be accomplished...?
thanks in advance.
Thank you,
Anu
Anu
How are you getting xx1 and yy1. How do you know you need to make 3 copies of each row. If that remains static, feed the input file the transformer with three output links, add two columns, duplicate the first three columns, add appropriate value for fourth and fifth column in the three links. Concatenate the files together.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Thank you all for your time.
each row may be needed to copy more than thrice depending on case.But based on the case 'Number of Copies' I need to make is static(i.e 3/10/50..).
If its '3', having 3 streams to feed 3 transformers sounds good. But if its '50', we probably may need better approach.
'xx1' and 'yy1' are sample values i took. But really they look some thing different.So I can not go for incrementing a number.But these values are static even in case of '50' copies..
thanks again...
each row may be needed to copy more than thrice depending on case.But based on the case 'Number of Copies' I need to make is static(i.e 3/10/50..).
If its '3', having 3 streams to feed 3 transformers sounds good. But if its '50', we probably may need better approach.
'xx1' and 'yy1' are sample values i took. But really they look some thing different.So I can not go for incrementing a number.But these values are static even in case of '50' copies..
thanks again...
DSguru2B wrote:How are you getting xx1 and yy1. How do you know you need to make 3 copies of each row. If that remains static, feed the input file the transformer with three output links, add two columns, duplicate the first three columns, add appropriate value for fourth and fifth column in the three links. Concatenate the files together.
Thank you,
Anu
Anu
Hi Anu,
Again where you get these case from? Perhaps you havent mentioned here.
There are several other ways of acheiving this. viewtopic.php?t=88639 You can create a parallel routine as well.
Again where you get these case from? Perhaps you havent mentioned here.
There are several other ways of acheiving this. viewtopic.php?t=88639 You can create a parallel routine as well.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
source :
100 DAVE YAHOO
200 ANN MS
300 SCOTT ORACLE
output
100 DAVE YAHOO 1 CHRONIC
100 DAVE YAHOO 2 HELTHY
100 DAVE YAHOO 3 CORDIAC
200 ANN MS 1 CHRONIC
200 ANN MS 2 HELTHY
200 ANN MS 3 CORDIAC
300 SCOTT ORACLE 1 CHRONIC
300 SCOTT ORACLE 2 HELTHY
300 SCOTT ORACLE 3 CORDIAC
in this case below are static.
1 CHRONIC
2 HELTHY
3 CORDIAC
I need to make 3 copies of each incoming row.
thanks
100 DAVE YAHOO
200 ANN MS
300 SCOTT ORACLE
output
100 DAVE YAHOO 1 CHRONIC
100 DAVE YAHOO 2 HELTHY
100 DAVE YAHOO 3 CORDIAC
200 ANN MS 1 CHRONIC
200 ANN MS 2 HELTHY
200 ANN MS 3 CORDIAC
300 SCOTT ORACLE 1 CHRONIC
300 SCOTT ORACLE 2 HELTHY
300 SCOTT ORACLE 3 CORDIAC
in this case below are static.
1 CHRONIC
2 HELTHY
3 CORDIAC
I need to make 3 copies of each incoming row.
thanks
DSguru2B wrote:Need actual sample data with explanation of how each case is derived.
Thank you,
Anu
Anu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or a Lookup from a three row table, allowing multiple row return. Create a Lookup File Set with "X" as the key for all three columns (you will need to set "allow duplicates" to true). Then lookup against the key value "X", with the drop down list allowing multiple row returns from that reference link. Use Entire partitioning for the Lookup File Set.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.