Divide Column based on InString Character

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
ryanrabo22
Participant
Posts: 4
Joined: Wed Aug 04, 2010 12:28 pm

Divide Column based on InString Character

Post by ryanrabo22 »

Hello,
I have a column with data coming in this format "ABC:123". I am wondering if there is a way or function that can find the ":" character, such as InStr, and then give me the value to the Left without the ":". I need my final output from "ABC:123" to be "ABC". The lengths of "ABC" and "123" within the column are variable. I have looked through the functions in the transformer stage, but I cannot think of a solution using the functions available. Any help would be greatly appreciated!


Thanks,
Ryan
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Check FIELD function.. It can fulfil your requirement.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

Field(InLink.TheString, ":", 1, 1)
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