split multiple rows

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
snt_ds
Premium Member
Premium Member
Posts: 280
Joined: Wed Oct 18, 2006 11:53 am
Location: Pune, India

split multiple rows

Post by snt_ds »

hi,

how to split multiple records based on delimiter

source is 1#2#3#4#5 ..n

it should be present in target like this
Ans
-------
1
2
3
4
5
.
.
n


Regds
Ramesh
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post by varaprasad »

specify the record delimiter as '#' in the file format properties.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Parse into separate columns then run these through a Pivot stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
snt_ds
Premium Member
Premium Member
Posts: 280
Joined: Wed Oct 18, 2006 11:53 am
Location: Pune, India

Post by snt_ds »

ray.wurlod wrote:Parse into separate columns then run these through a Pivot stage.
Thanks Ray
But the value of 'n' is not fixed.
please suggest.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Configure enough columns for the largest expected N.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Convert the # to @VM and load into a hashed file with a key generated as @OUTROWNUM. Then read from the hashed file dynamically normalized on your multi-valued column. You will need to set up the table definition with the "supports multi-valued columns" check box selected.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post by varaprasad »

I mentioned 'record delimiter' NOT 'field delimiter'
I believe it should work in ur scenario.
Post Reply