Need to trim Special Character

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
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Need to trim Special Character

Post by gssr »

I need to Trim the special Character "
" Tab Char.

I used Trim function ,but throughs me error!!!

Any Suggestions!

Thanks in Advance!
RAJ
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Specify the tab character in the Trim() function as the character to be trimmed.

The tab character can be represented as Char(9).

Performance tip: Evaluate Char(9) when initializing a stage variable (perhaps called svTab). Then don't provide a derivation for this stage variable in the main part of the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

ray.wurlod wrote:Specify the tab character in the Trim() function as the character to be trimmed.

The tab character can be represented as Char(9).

Performance tip: Evaluate Char(9) when initializing a stage vari ...
I could not able to mention the Tab Char in the Trim function. Do i have to mention Char(9) for it?

Thanks,
RAJ
naveen.p
Participant
Posts: 55
Joined: Sat Nov 21, 2009 5:19 am
Location: Chennai

Post by naveen.p »

Could you try these functions with the strip characters

TrimB Remove all trailing spaces and tabs
TrimF Remove all leading spaces and tabs
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

It removes only the spaces, the source file has the "Tab Character" in it
RAJ
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

gssr wrote:Do i have to mention Char(9) for it?
Yes. And that is the resolution, not a 'workaround'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Were you to follow my advice you would mention, in the Trim() function, the stage variable whose value has been initialized to Char(9).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

Thank you all. The problem is resolved
RAJ
Post Reply