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
dsxuserrio
Participant
Posts: 82
Joined: Thu Dec 02, 2004 10:27 pm
Location: INDIA

Varchar to decimal -

Post by dsxuserrio »

I am reading several fields as varchar and in the first transformer I just choose the data type as decimal 15 and everything worked fine as expected. The max I had to do was in the transformer use

Code: Select all

IF IsNull(filed) Then 0 Else filed
But for only one field I could not get away with this. I had to use handle_null in a modify stage.
Otherwise when I validate I get an error message something like
Wen converting form string to decimal , no null handling etc....


Any ideas??
dsxuserrio

Kannan.N
Bangalore,INDIA
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
I think if you'll look at documented conversions you'll find a potential null being the result,
If there is any chance for a null that is enough to "force" you handle nulls.
I guess it's just not that obvious to us it could happen or to the engine that it can't.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Code: Select all

If IsNull(input.value) Then 0.00 Else StringToDecimal(input.value)
In DataStage's transformer, Integer and Characters are interchangeable.

Edit:
will any official course provide the DS knowladge I seek or is it only an Ascential employee priviladge?
Depends on what you want to know! :lol:
Post Reply