Lookup value 0

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
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Lookup value 0

Post by pratapsriram »

What does a resulting value of 0 mean when we do a lookup?

I have an Underwriter_id(char 10) in Source. User_id(carchar 10) in lookup table. The data types are different. But the lookup is failing. But if I do it from the database then the match is there. So if the lookup action is drop then the record is dropped. If it is continue then the peek stage shows the value as 0000000000. So wondering how to do this. I have used UpCase(TrimB(User_Id)) for lookup and respectively for the Underwriter_id too but still getting this error. Is this a problem because of the datatype? Just mind boggling.
Knowledge is Power
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Is there any auto conversion into Integer?
Try to make sime dataytpe at both input and reference. Try converting the Char into Varchar.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

A char 10 will be of length 10 padded with whatever you padchar is set to (seemingly 0...) so unless your are actually comparing 10 against 10, you're unlikely to get the match, you will need to convert to varchar with trimming pad character or convert the varchar to char 10 (former sounds preferable)
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Post by pratapsriram »

So I should include the APT_PADCHAR in the parameters and change the datatype to resolve this issue?
Knowledge is Power
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Post by pratapsriram »

So I should include the APT_PADCHAR in the parameters and change the datatype to resolve this issue?
Knowledge is Power
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

What have you set the APT_PADCHAR to?

Easiest start will probably be to send your lookup to a peek, maybe with a transform in the middle to surround the value in braces or convert the field to hex. I can't say what your data looks like so can't recommend a solution but clearly one side is not the same as the other.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Char(10) to Integer may be illegal, if the value is greater than 2^31-1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Lookup value 0

Post by SURA »

If your source and lookup data is from table, then you can do type cast the data to common data without affecting the value of the data, before it do the lookup.

DS User
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Post by pratapsriram »

I changed the datatype to varchar(10) on both the source link and the lookup links and added APT_STRINGPADCHAR of 0x0. Still getting the same problem. So now going to change both of the links to Char(10) and try. Hope it works.
Knowledge is Power
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Post by pratapsriram »

Yes!!!! Changing to to Char(10) on both the links worked. One more thing the data is alphanumerical just an FYI so it can help others later on.
Knowledge is Power
Post Reply