Stringtodecimal conversion error

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
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Stringtodecimal conversion error

Post by keshav0307 »

I have input of char( 8 ), how to convert it to decimal ( 8,8 ) in a transform stage.
it's working fine to convert decimal ( 8,0 ).
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

What happens when you try to convert it to decimal[8,8]? Does it give any error?
Kris

Where's the "Any" key?-Homer Simpson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Precision must be at least one larger than scale. Decimal(8,8) is not an acceptable formulation; you need at least Decimal(9,8) to accommodate eight decimal places.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

What happens when you try to convert it to decimal[8,8]? Does it give any error?
it convert any values to 0.00000000
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

Another thing i noticed is :
when the input is 00000000, StringToDecimal does not work.
pankajg
Participant
Posts: 39
Joined: Mon Jun 05, 2006 5:24 am
Location: India

Post by pankajg »

Ray, why does the precision needs to be larger than scale?? Any particular reason, and if the scale=percision what's the problem in there?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's just something I've noticed over the years. Decimal[N,N] should be able to represent numbers between zero and less than 1.0, theoretically, but it seems that some implementations need to be able to specify that there is a digit to the left of the decimal place holder.
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