TRIM 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
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

TRIM function

Post by just4u_sharath »

Hello,
I want to trim the leading and trailing occurance of *.
Input field = ***abc***. output should be abc

If i use TRIM(***abc****,'*','B') but i am getting the output as
abc***. In the help section i found that B will remove all the leading and trailing characters.

Just Trim(***abc****,'*') gave me abc*

Thanks
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: TRIM function

Post by SURA »

Trim (Col,'*','A')

Ereplace also help you.

Refer the help.


DS User
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Re: TRIM function

Post by BI-RMA »

just4u_sharath wrote:If i use TRIM(***abc****,'*','B') but i am getting the output as
abc***.
In my 8.0.1 FP1a installation I get 'abc' for TRIM(DUMMY,'*','B') where DUMMY has the value '***abc****'. The TRIM-function you quoted is invalid (missing quotes).
What version are You running?

Edit: TRIM(DUMMY,'*') returns the same.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
max.madsen
Premium Member
Premium Member
Posts: 62
Joined: Tue Dec 07, 2004 7:41 am
Location: Brasil
Contact:

Re: TRIM function

Post by max.madsen »

Do you want remove only leading and trailing characters? not all characters?
E.g.:
The result for "***ab*c***" and "***abc*****" will be different?

If you dont have success with "trim", try use "convert" function.
Convert("*","",DUMMY)

Best regards!
Post Reply