Data type conversion function

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
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Data type conversion function

Post 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!
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post 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.
Regards,
Balaji.
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Post 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?
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post 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?
Regards,
Balaji.
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Post 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 ..
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post 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....
Regards,
Balaji.
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Post 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..
Post Reply