Pivot stage upstream of Column Import stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rajeshknl
Participant
Posts: 22
Joined: Thu Jul 17, 2008 8:09 pm

Pivot stage upstream of Column Import stage

Post by rajeshknl »

Hi,
I have to read a delimited file(,) with varying number of columns. Also turn the columns into multiple rows.

EX: Input rec_time,Acc_time,Para_ID,Tower_ID
Ouptput rec_time
Acc_time
Para_ID
Tower_ID

I can use a schema file as the no of columns vary but how do i connect the pivot stage without knowing the no/names of columns.

Is there any alternative solution. Any help is appreciated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

To use a Pivot stage you must name at least the pivot key column and the pivoting columns. Therefore a "pure" RCP solution is not viable.

You need to pre-parse your data. That is, you can not rely on a schema file in this case.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rajeshknl
Participant
Posts: 22
Joined: Thu Jul 17, 2008 8:09 pm

Post by rajeshknl »

Thanks

Is there a way to count the no of times the delimiter repeats and pass that as a parameter. i am just guessing wildly.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please explain that requirement more carefully. Parameters can only be passed before the job runs, so whatever it is that you are proposing would require some kind of pre-processing of the source data.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply