splitting the column

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
srekant
Premium Member
Premium Member
Posts: 85
Joined: Wed Jan 19, 2005 6:52 am
Location: Detroit

splitting the column

Post by srekant »

Hai,
I have a scenario where the source file is of format

Code: Select all

Source                             Sample Input Data  
Year          -------------------------- 2002
Month        -------------------------- 02
Month        ---------------------------02
COMC        ---------------------------4089
GROUP ------------------------------511111111
CS         -----------------------------80000000

Target                                    Sample Input Data     
Year               ===============2005
Month             ===============02
Month            ===============  02
yppp             =============== 66666        
ACCT            ===============55555
Amount          ==============987527866
how can i go about achieving this and also I am planning to read input as a single column and after that how can i go about splitting the single column .

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

Post by ray.wurlod »

Presumably, if you're going to read it as a single column, the data type of that column will be a character string of some kind (Char or VarChar).

So you can use substring techniques to split out different substrings from the original string.

For example, YEAR would be InLink.TheColumn[1,4]
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
srekant
Premium Member
Premium Member
Posts: 85
Joined: Wed Jan 19, 2005 6:52 am
Location: Detroit

Post by srekant »

but my source file is like this

A2005
B02
C02
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000
4080,556095100,50000000

if i take substr(1,4) then only 3 column will be outputed but i want the out put like

2005
02
02
21101.I,1015.000,218527866
21101.I,1120.001,5106749675
21101.I,1120.001,2225868552
21101.I,1475.000,350898066
21101.I,1476.001,795565318
21101.I,1476.002,71979153
21101.I,1477.001,474542085
21101.I,1477.002,13014866
21101.I,2500.005,-200379327
Sree
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I answered the second question, about how to handle the input being a single row. You may need more than one output from a Transformer stage to handle different record types.

As to adding data to the output record, you have to tell us where you're getting those other data from, then - and only then - could we recommend a mechanism for retrieving them.
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