Decimal Length

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
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Decimal Length

Post by devidotcom »

Hi All,

I had a very simple question..

I have field of datatype Decimal (15,4)
Can I read a number value of 2774389000000 in this field?

I am trying to understand the Varchar length accepted to read the value.

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

Post by ray.wurlod »

Decimal(15,4) has a total of 15 significant digits. Four of these are to the right of the decimal point, which means you can have a maximum of 11 to the left of the decimal point.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So, can you have 2774389000000 in a Decimal(15,4) field?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Your decimal definition states a total of 15 digits, 4 of which will be after the decimal point: 99999999999.9999. You can safely load any value up to a length matching the above format (17 bytes in total including decimal point and a sign).

Any value that exceeds the format definition risks being truncated (12 or more digits to the left of the decimal point, 5 or more to the right).

Value is the key word here. 1 and 0000000000000001 are different string lengths but have the same numeric value of 1--both have one significant digit.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply