StringToDecimal

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
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

StringToDecimal

Post by benny.lbs »

I have a report in following format

Code: Select all

12345678901234567890
--------------------
          23,030.12-
The negative sign is in the trailing position and there is comma inside the string, I would like to know what 's the best solution to convert this string into Decimal

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

Post by ray.wurlod »

Assuming that the data type is a string of some kind, a buildop to remove the thousands delimiter(s), detect the sign and move it to the front of the string seems to be the way to go.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

ray.wurlod wrote:Assuming that the data type is a string of some kind, a buildop to remove the thousands delimiter(s), detect the sign and move it to the front of the string seems to be the way to go.
Hi,
I came across the same situation in my proj,wat i did exactly ruy suggest,moved the trailing -ve sign to prefix it ant trim ',' sign using stage varibles.
dsx_venkat
Participant
Posts: 12
Joined: Thu Sep 01, 2005 10:49 pm

Post by dsx_venkat »

Even myself faced this problem, i choosed external routines (C routines)
and converted into parallel routines,
Post Reply