Page 1 of 1

Type Conversion before Look up

Posted: Wed Jan 19, 2005 3:58 pm
by FanWeik
Hi All,

I am using newvalue:string = string_from_decimal (oldvalue) in the Modify stage to convert the type from decimal to string before I do a lookup against a DB2 table where the key is defined as char.

My questions are:
1. The oldvalue is 000. After the job is executed, it converted the oldvalue to ' 00'. Why would it do that? Well, I expected it to be '000'.

2. Is there a way that I can do a type conversion in the DB2 stage when the lookup is happening?

Thanks!!
Fan

Posted: Wed Jan 19, 2005 7:08 pm
by T42
It's a signed conversion. You may have "-00" after all. Provide enough room for the sign.

Posted: Thu Jan 20, 2005 4:31 pm
by FanWeik
That must be it. I got ' 000' but when I use it to do a lookup, it's using ' 00' which couldn't find anything of course.

I am able to do a type conversion in the DB2 table before the lookup so I don't need to use the Modify stage. But it's good to know that the string_from_decimal function will allocate a space for the sign.

Thanks.