Concatenating strings for the same nonunique key values

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
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Concatenating strings for the same nonunique key values

Post by I_Server_Whale »

Hi all,

I have the following input data:

Code: Select all

Input 
          
1       Tiger           
1       Mohan          
1       Chow           
2       Christie
2       John
3       Ruth
3       Babe
and I'm looking to get this data in the following output format:

Code: Select all

Output

1        Tiger Mohan Chow
2        Christie John
3        Ruth Babe
What is the best way to code this via a PX job? Greatly appreciate your inputs!

TIA,
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, at its heart that is basically a vertical pivot of rows to columns. Clarify for us your "output format" is destined for what - a flat file, a table? That would drive the post-pivot shenanigans you'd need, it seems to me.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pivot followed by Column Export
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply