Conversion - Varchar To Decimal

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
Oritech
Premium Member
Premium Member
Posts: 140
Joined: Thu May 07, 2009 9:32 pm

Conversion - Varchar To Decimal

Post by Oritech »

I am trying to convert in transformer

Varchar To Decimal 38 , 10

Incoming value is DU 2015F21

Tried StringToDecimal(Ln_name.Input) function

Its converting incoming value DU 2015F21 to 0

Pls advice .
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

"DU 2015F21" does this value look like decimal. NO. So when converted to decimal default value is assigned.

If there is a conversion logic to convert this to a numeric value, you may want to implement the logic explicitly in the transformer stage and then map it to a decimal field.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could use the IsValid() function to filter records in which the incoming value is convertible to Decimal data type. "DU 2015F21" is not one of this class. You need to design a strategy to capture and process invalid data, even if it's only to initiate remediation of source data.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply