How to handle this string

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
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

How to handle this string

Post by vskr72 »

I have a strign like this assigned to a column:

Code: Select all

"IBM G52 17"" COLOR MONITOR (476)"
I want to convert this to

Code: Select all

IBM G52 17 COLOR MONITOR (476)
Tried using the following in Trim. But it gives a syntax error:

Code: Select all

Trim(Trim(ToTfm.DESCRIPTION, "\""), " ")
Any inputs pls? Thank you.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

For me it looks like:

Code: Select all

Convert(",'',trim(input))
If the above doesnt work try:

Escape the first argument \" and try.
pandeeswaran
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You just need to remove the double quotes? No need to escape anything, just use single quotes in the function call:

Code: Select all

Convert('"','',ToTfm.DESCRIPTION)
-craig

"You can never have too many knives" -- Logan Nine Fingers
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Post by vskr72 »

Craig - that worked good. Why didnt I think of this. I was always trying to use the escape character.
Post Reply