Hi folks,
Input is like this,
10
15
256
765
Im trying to get Output in this format:
10,15,256,765
i need to insert comma between each record like above format.
thanks
har
convert single column records into a string
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Process this in UNIX, using a utility like sed to change all the line terminator characters to commas.
This leaves a blank final field, you can further process the result if this will be a problem.
It can be done in DataStage, but is easier and faster using the sed utility.
This leaves a blank final field, you can further process the result if this will be a problem.
It can be done in DataStage, but is easier and faster using the sed utility.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The easiest way to do this in DataStage is as follows.
- In a Transformer stage construct a stage variable, which accumulates the comma-delimited string.
Run the output through a subsequent Aggregator stage, using Last as the aggregate function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
use row merger
you can use row merger read the source file into a multi column file then use row merger stage read this file and merg all column into one cloumn. It is easy to use.