Page 1 of 1

How can I genarate multiple rows from a single row

Posted: Fri Dec 07, 2007 1:59 pm
by deva
Hi All,
I have one requirement. I have 3 cols one is cust id,eff.date,no.of.installments.
My question is if custid is 1000 and eff.date is feb/12/2002, and number of installments are 4.
I am looking for the output with 4 rows.
1000 feb/12/2002 4
1000 feb/12/2002 4
1000 feb/12/2002 4
1000 feb/12/2002 4

we are using 7.1/ 7.5 datastage server.

Thanks in advance

Posted: Fri Dec 07, 2007 2:05 pm
by swades
Can you provide more details.

You can do:-
Read installments as source ,and do ODBC look up against same table,using installments as key.

Posted: Fri Dec 07, 2007 2:44 pm
by chulett
How is this different from your other post? :?

Posted: Tue Dec 11, 2007 12:18 am
by sreeni
Try to use Job activity stage to call your job in Start loop and End loop activity stages in the Job sequencer. Use Start value = 1 , End Value =4.
Then same input record gets inserted into output stage four times.

Posted: Tue Dec 11, 2007 12:20 am
by sreeni
Try to use Job activity stage to call your job in Start loop and End loop activity stages in the Job sequencer. Use Start value = 1 , End Value =4.
Then same input record gets inserted into output stage four times.

Posted: Wed Dec 12, 2007 2:48 pm
by DSguru2B
Write a small routine that takes in the entire record of three columns as a single argument, get the "Installment" count and run a loop equal to the installment count. Within the loop, concatenate the entire record with each other delimited with a line feed. Since you are on windows, it will be Char(013):Char(010).
This way you will feed in one row and get x rows where x is your installment count.