Trim ' and "

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
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Trim ' and "

Post by devidotcom »

Hi All,

I have a requirement to trim i.e, remove single quote ' and double quote " from a string.

How can I do this.
I tried the following

Trim (string,'"','A') and also Trim(string,''','A')

But this does not work.

Any help.

Thanks
Devi
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post by mahadev.v »

Try with an escape character. Like Trim(Input.Col,"\'",'A'). Or use the ascii value for the characters. Trim(Input.Col,CHAR(39),'A')
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In Server

Code: Select all

TRIM(\"'\,'A')
would work but I don't know if that applies to PX transforms. If not, use

Code: Select all

TRIM(CHAR(34):CHAR(39),'A')
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does backslash work as a quote character? If so you can have

Code: Select all

Convert(\'"\,\\,InLink.TheColumn)
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