Trim leading zero's

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Trim leading zero's

Post by satheesh_color »

Hi All,

I have an requirement to obtain the pricevalue from Oracle(Decimal 11,2) to create an dataset and this will be the source of MQSeries(JDA is the target system).

Eg:Input

00000000049.99
00000000159.90

Eg:Output

49.99
159.90

I just need a output as above,Please let me know your inputs on this.


Thanks,
Satheesh
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Code: Select all

Trim(field,'0','L')
You are the creator of your destiny - Swami Vivekananda
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Post by satheesh_color »

Hi Anbu,

I failed to execute your input in my PX job(as the column as described in decimal(11,2).


Thanks,
Satheesh
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Can you post the error message?
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There won't be an error as while they may get trimmed, the Decimal datatype puts them right back. You'd need to target a Varchar if you didn't want the zeroes: DecimalToString()
-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 »

The leading zeroes are not significant. Don't worry about them. They are there to prove that precision and scale are being handled correctly. The internal representation, both in DataStage and in Oracle, is binary.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... and yet we all know how much people like to worry, even about insignificant things. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply