help needed on rows to column

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
jeyavel
Participant
Posts: 2
Joined: Thu Mar 22, 2007 10:39 am

help needed on rows to column

Post by jeyavel »

I have a file like this

ACCT_NO CUST_ID
0001 aaaa
0001 bbbb
0002 cccc
0002 ddd
0003 fff
0003 eee
0003 ggg
. .
. .
. .
0003 n

I need a output like this.

Acct_no Cust_id
0001 aaaa+bbbb
0002 cccc+ddd
0003 fff+eee+ggg......+n

How to achive this result?.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Sort input data by grouping columns, use stage variables in Transformer stage to build result row, output to Aggregator grouping by group-by columns with LAST action on all other columns, output to Sequential file resultant rows.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or instead of sending to aggregator, load it to hashed file keyed on ACCT_NO. This will automatically retain the last row.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply