Concatenate rows into 1 row and 1 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
rodre
Premium Member
Premium Member
Posts: 218
Joined: Wed Mar 01, 2006 1:28 pm
Location: Tennessee

Concatenate rows into 1 row and 1 column

Post by rodre »

Need to concatenate rows into columns:
example:
A
B
C
D
etc
into:
A,B,C,D etc...
I found some relevant posts on sequential file "Filter Command" but it does not work in 8.1 windows datastage.

For example:
cat f:\Data\Comm\ppt9.txt | tr '\n' ','

it does not like the pipe character, it completely wipes out the rest of the command.
or gives me a syntax error. Maybe this work in UNIX but not in Windows.

Does any know the filter concatenate syntax?
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

In a Server job, you might try the Row Merger stage with this option:
Multiple Lines. This determines whether the Row Merger stage concatenates input rows into a single output row, or whether it outputs each input row as a separate output row. Select Multiple Lines to have the rows concatenated. By default it is not selected.
I have not used it myself, but by the description it sounds like it's worth testing.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply