ROW SPLITTER PROBLEM

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
ianm
Charter Member
Charter Member
Posts: 15
Joined: Thu Sep 16, 2004 6:13 am

ROW SPLITTER PROBLEM

Post by ianm »

I've found topics on rowsplitter but they don't give me an answer to my particuler problem.

I have an Oracle table that contains columns :-
Orderref varchar(6)
Status varchar(2)
Submission_Tstamp Timetamp (19)
Order_Data varchar(2040)

Order_Data contains information about options the customer selected when placing the order. The option codes appear at 12 character intervals.

e.g.
code1.......code2.......code3.......code4 e.t.c.

I am trying to break the Order_Data column into multiple rows so I end up with :-
e.g.
OrderRef Status Submission_Tstamp Option
====== ==== ============= ====
000001 01 2004-07-11 00:00:00 Code1
000001 01 2004-07-11 00:00:00 Code2
000001 01 2004-07-11 00:00:00 Code3
000001 01 2004-07-11 00:00:00 Code4

I am using a job :-
OCI ==> Row Splitter ==> seq File


If on the output I specify the single column Option varchar(12) as fixed width(12) it works o.k.
Option
====
Code1
Code2
Code3
Code4

but as soon as I try to add in the other columns I want passed through I start to have problems. Either "Required Column Missing" which they aren't as they are specified in the OCI source stage.
If I turn of the Missing column message then it tries to split the Order_Data column over the extra columns
e.g.
OrderRef Status Submission_Tstamp Option
====== ==== ============= ====
Row1 Code1 Co de2Code3Code 4000001

or something close to that.

Is there some setting that I am missing?
I've tried swapping the order of the columns around to no avail.

Can anybody help ?

ianm
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Looks like you've picked the wrong stage type. Investigate the Pivot stage for this particular task.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ianm
Charter Member
Charter Member
Posts: 15
Joined: Thu Sep 16, 2004 6:13 am

Post by ianm »

Thanks Ray.
I did use the pivot stage in the end although it was a tedious way round, having to split the data out into columns first then combining them back together again.
Leaves me wondering what the point of the row splitter stage is though ?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you try passing the column to break alone?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Row Splitter can do the breakout into separate columns.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

But starting from step 1 will be a good guide to identify where the columns disappear.
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Post by talk2shaanc »

row spliter splits A row, NOT spilts into rows.
Taking a simple example. if have column Name with value James Anderson
Then using row splitter you can have two column First name=James and Last Name=Anderson.

The row splitter stage is similar to the server sequential file stage. The difference is that, while the sequential file stage reads from a file, the row splitter stage reads from a link.

For your requirement, I would suggest pivot or in the transformer have one column as output, to which you give derivation code1:char(13):char(10):code2:char(13):char(10):code3:char(13):char(10):code4....and so on.
Shantanu Choudhary
Post Reply