I want to stripout the '-'

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
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

I want to stripout the '-'

Post by pavankatra »

Hi,
I want to stripout the '-' from the string,so could anyone please suggest me which function is more helpful.

Thanks in Advance

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

Post by ray.wurlod »

Convert()
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

ray.wurlod wrote:Convert() ...
hi ray,
i have used convert function like
convert('-',' ',inputlinkname)

can you please let me know whether it is right or not.

THanks
Pavan Kumar
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

hello .that correct.you are converting it to space .trim it also
thanks n regards
nani
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

nani0907 wrote:hello .that correct.you are converting it to space .trim it also
yes
that is working,Thanks RAY
Thanks
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or just convert it to an empty string rather than a space, save the whole 'trim' part.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavankatra
Participant
Posts: 86
Joined: Wed Mar 03, 2010 3:09 am

Post by pavankatra »

chulett wrote:Or just convert it to an empty string rather than a space, save the whole 'trim' part. ...
yes it is resolved.
my input is 12345-3-2
expected output is:1234532

for this i used StripWhiteSpace(convert(columnname,'-',' ')).

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

Post by ray.wurlod »

Code: Select all

Convert("-", "", InLink.ColumnName) 
was all you needed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly.
-craig

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