Page 1 of 1

Data type conversion function

Posted: Wed Dec 20, 2006 2:01 am
by vij
Hi all,

1. i would want to know wat function i need to use to convert a string value to integer value.

2. Also i get this warning, wen i ran my job:

APT_CombinedOperatorController,0: APT_Decimal::operator=: the source decimal has even precision, but non-zero in the leading nybble, or is too large for the destination decimal.

can any one pls answer my questions?

Thanks in advance!

Posted: Wed Dec 20, 2006 2:40 am
by BalageBaju
Hi,
APT_CombinedOperatorController,0: APT_Decimal::operator=: the source decimal has even precision, but non-zero in the leading nybble, or is too large for the destination decimal.
Is your input column having any decimal values? If it is, then you can go for the function 'StringToDecimal'. (Since you have mentioned some decimal precision warnings).

If your input contains only integers then use the function 'AsInteger'. This will treat the given value as Integer.

Posted: Wed Dec 20, 2006 3:01 am
by vij
yes, i do have decimal values from input... but i dont think there would be a problem in reading the decimal precision value ... can u throw more light on this?

Posted: Wed Dec 20, 2006 3:12 am
by BalageBaju
Hi,

In the warning message it is given that,
or is too large for the destination decimal
so plz check the datatype and size in your target. This might be the reason...

Did you tried with the function 'StringToDecimal'? Is it giving the same warnings?

Posted: Wed Dec 20, 2006 5:39 am
by vij
for a decimal value wth length as 9 and precision 2, i shuld define in datastage as below rite? correct me if i am wrong ...
length precision
9 7

becos i still face the same problem ... pls help me in solving this ..

Posted: Wed Dec 20, 2006 6:06 am
by BalageBaju
Hi,

I think you are in wrong way. Are you hardcoding the metadata? If yes, this is not a good practice to do so. Always it is better to import the meta data through Datastage Manager is the good way.
length precision
for a decimal value wth length as 9 and precision 2, i shuld define in datastage as below rite? correct me if i am wrong ...
length precision
9 7
I think for this you should mention the lenght as 11 and precision as 2. In the length column you should mention the full length of the column including precision part and in the precision part you want to mention the column precision(no. of digits after decimal part).

Hope this will help you....

Posted: Wed Dec 20, 2006 6:37 am
by vij
thanks for ur help ...
i have some problem in the data also, i am correcting it now .. but i am not sure whether that is the problem..