Page 1 of 1

Concatenate rows into 1 row and 1 column

Posted: Wed Feb 22, 2012 4:36 pm
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?

Posted: Wed Feb 22, 2012 6:08 pm
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.