Type Conversion before Look up

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
FanWeik
Participant
Posts: 10
Joined: Mon Apr 26, 2004 11:40 am
Location: Seattle WA

Type Conversion before Look up

Post 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
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

It's a signed conversion. You may have "-00" after all. Provide enough room for the sign.
FanWeik
Participant
Posts: 10
Joined: Mon Apr 26, 2004 11:40 am
Location: Seattle WA

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