Page 1 of 1

split record to multiple based on the counter

Posted: Fri Jun 08, 2007 12:35 pm
by mujeebur
[code]

Appreciated your help to achieve below:

I have data coming in the format :

Input
-----------
rec_no ctr code
1 3 ABCD DEFG HIJK
2 2 ABCD DEFG

Output
---------
rec_no ctr code
1 3 ABCD
1 3 DEFG
1 3 HIJK
2 2 ABCD
2 2 DEFG


I have to split the record based on the Counter.

[/code]

Posted: Fri Jun 08, 2007 12:42 pm
by DSguru2B
You can use the pivot stage. Read about the pivot stage to see how this can be accomplised. Since its dynamic, I would just write a shell script to do it.

Posted: Fri Jun 08, 2007 1:11 pm
by mujeebur
I belive( what I understood from docs ) , Pivit only write Rows to Coumns.

Posted: Fri Jun 08, 2007 1:13 pm
by chulett
No, the Pivot stage is columns to rows.

Posted: Mon Jun 11, 2007 10:36 am
by mujeebur
I followed the this approach.

viewtopic.php?t=110457&highlight=pivot