Left or right function using INDEX() function

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
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Left or right function using INDEX() function

Post by Javieregh »

Hi

I'm trying to extract part of a string (eg. extract "yahoo.com" from " email@yahoo.com ") using the Left function. eg.

Right(myString, Index(myString,"@",1)+1)

but don't work

Please is there a known issue or am i doing something wrong here?

Prompt reply appreciated. Thanks

Xavi
Consultant in DTS
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Post by Javieregh »

Field (inputstring,'@',2)
Consultant in DTS
HariK
Participant
Posts: 68
Joined: Thu May 17, 2007 1:50 am

Re: Left or right function using INDEX() function

Post by HariK »

Javieregh wrote:Right(myString, Index(myString,"@",1)+1)
Right(myString, Len(myString) - Index(myString,"@",1)) Would have worked.
Post Reply