Reading Data from Dataset

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
varshanswamy
Participant
Posts: 48
Joined: Thu Mar 11, 2004 10:32 pm

Reading Data from Dataset

Post by varshanswamy »

Hi,

I have data of ten digits say for example 3024410009, I have given the Data Type to be BigInt and the Precision to be 32. I am reading this data in a dataset but it reads it as a negative number. Could you please tell me which data type and whioch precision would be the best for such kind of data.

regards,
varsha
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

When you are dealing with integers, you can give it any precision numbers you want, but...

Datastage will ignore the precision number when it handles Integers.

If you MUST have a specific length for numbers, either use Varchar, or Decimal.

Integers are exactly the same as C's Integers.

P.S. Integers can hold data up around 10 digits long (For 32-bit DataStage.)
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

You can use integer, but you must use an unsigned integer.

A signed integer can hold values from -2 ^ 31 through +(2^31) - 1, or -2147483648 to +2147483647 (approx -2.1 billion to +2.1 billion)

An unsigned integer can hold from 0 to +(2^32) - 1 = +4294967295 (0 to approx. +4.3 billion)

If you know the minimum and maximum values of your input field are within these ranges, then you can use integer. Otherwise, like T42 says, you'll need to hold it in a varchar/char or decimal field.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

You can use a BigInt if you want. My talk of the decimal field is specifically for those 'fixed length' fields that some clients (especially those with mainframe-produced data) like to see and use.
Post Reply