column import

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
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

column import

Post by just4u_sharath »

i have the data like
Field1
aaaaaaa
bbbbbbb
cccccccc
ddddddd
eeeeeee.
Now i have to split this field1 to field 2 and filed 3
where filed2 should contain the 1st 3 chars and field3 should contain the last 4 chars. I can do this using a transformer. But i wish to use column import. Can i split the record using column import stage eventhough the input filed doesnt have a DELIMITER.
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

Nope.

What's the attraction to the Column Import stage? Don't get me wrong, it's a great stage - It's got a pretty cool icon too! Do you subscribe to the 'transformers are expensive and to be avoided unless absolutely necessary' ethos? Many people do.

If you want to avoid a transformer you could try a Modify stage which would derive 2 new output columns using the substring function:

Code: Select all

string = substring[start,length](string)
E.g.

Code: Select all

field2:string = substring[1, 3](field1)
field3:string = substring[4, 4](field1)
(That's off the top of my head - no warranty implied!)

J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:!:
Modify stage uses zero-based counting.

Nothing wrong with Transformer stages (these days) either.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Post by just4u_sharath »

ray.wurlod wrote::!:
Modify stage uses zero-based counting.

Nothing wrong with Transformer stages (these days) either.
I can get this funtionality using transformer. But i want to know the functionality of column import. Will it split the data if the data doesnt have any delimiters. Just learning the functionlaity of column import stage.
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Post by dsusr »

Column import will work fine in your case. Just define the schema as Fixed length file with no delimiter.

dsusr
Post Reply