Fetch Data based on delimiter

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
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Fetch Data based on delimiter

Post by dr.murthy »

Hi,

I need a some solution to achieve the below output.

my source data like
Hyderabad-HYD,scb
New Delhi,NDA,Ghs

O/p
---
Hyderabad
New Delhi

Here i need to fetch only the before first delimiter characters, it should be ignored after the -/, characters.
i have some solution to handle this
1)find the characters positions of (,-)
2)use field function to fetch the required characters by using min character position

is there any other simple way to implement this???
Thanks in advance..
D.N .MURTHY
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Almost there..

Convert all known/expected delimiters to single character & then select the first field using field function.
Kandy
_________________
Try and Try again…You will succeed atlast!!
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Field(Field(x, ",", 1), "-", 1)
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

Thanks kryton ..
D.N .MURTHY
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... resolved?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply