parallel job

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
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

parallel job

Post by samsuf2002 »

Hi All
i have an input flat file which contain data in this format

ID CODE D1 D2 D3 D4
123 1 a b c x
123 2 A B C Y
456 1 e f g h
456 2 E F G H

i need in out out this format

ID CODE1 D1 D2 D3 D4 CODE2 D1_2 D2_2 D3_2 D4_2
123 1 a b c x 2 A B C Y
456 1 e f g h 2 E F G H


can any one tell what stage can i use or what transformation i use in TX

Thanx
hi sam here
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you mean PX or TX? You've posted in the parallel (PX) forum, but asked a question about TX (Mercator). The answer will be different in each case.

In a parallel job I'd use a Transformer constrained to output only when CODE is 2. I'd store the code 1 column values in stage variables conditionally updated only when CODE is 1, and use these in the output column derivations.

This approach requires that the input is sorted by ID then by CODE and that there is a guaranteed code 2 for each code 1. Without that, the orphan code 1 rows will be discarded.

If you need a TX solution, please post the question on the TX forum.
Last edited by ray.wurlod on Wed Jul 19, 2006 5:29 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hi

What you are trying is known as 'Vertical Pivot' in PX, search on the keyword and you will get your answer.

Thanks
Sam
Post Reply