split record to multiple based on the counter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

split record to multiple based on the counter

Post 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]
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

Post by mujeebur »

I belive( what I understood from docs ) , Pivit only write Rows to Coumns.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, the Pivot stage is columns to rows.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

Post by mujeebur »

I followed the this approach.

viewtopic.php?t=110457&highlight=pivot
Post Reply