File Merge: multirows --> single row

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

File Merge: multirows --> single row

Post by admin »

Im trying to merge multiple rows of a source file into a single row in a target file. eg.
AAAA 0001 X
AAAA 0002 Y
BBBB 0003 X
CCCC 0004 X
CCCC 0005 Y

becomes:

AAAA 0001 0002
BBBB 0003
CCCC 0004 0005


Target file spec:
source.col1(join col) || source.col2(if col3 = X, always exists) || source.col2(if col3 = Y,otherwise blank)

I was thinking of using the Merge stage but Id first have to split the file into 2.

Any suggestions ?

regards,
Peter
Locked