suppress trailing zero

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
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

suppress trailing zero

Post by karthi_gana »

All,

I have a sequential file the below data.

100|2.156789345000000
100|2.620000000000000
100|2.234234132423240
100|2.100001000000000

I would like to remove the trailing zero's from the file. is it possible?

Expected Output:

100|2.156789345
100|2.62
100|2.23423413242324
100|2.100001

Inputs are welcome!
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, your target is another file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

you can use below derivation in transformer stage
trimb(columnname,'0')
Srinu Gadipudi
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: suppress trailing zero

Post by gateleys »

Try:

Code: Select all

TRIM(YourValue,"0","T")
Here, "T" implies Trailing.
gateleys
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes it's possible, but only if the target data type is a string of some kind.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Thanks for all . It works fine.
Karthik
Post Reply