Lookup Stage

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Lookup Stage

Post by Raftsman »

I am trying to perform a lookup on a table and all records are being rejected
The two keys that I am joining are

TypeA Char (30)
TypeB VarChar(20)

I changed the types so that they would be the same type and length and still they are all rejected. Can someone please tell me what I am doing wrong.

Thanks
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

Try trimming the data before lookup. trim them for any spaces
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Its pretty obvious that column TypeA is of length 30 and type char. That means if you have "Alpha" as a value in TypeA, it will still have length of 30, whereas if you have the value "Alpha" in a colum varchar of length 30, its length will only be 5.
Krazykoolrohit is right, trim the inputs and change the char to varchar.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you trim a Char datatype in a parallel job, the result is immediately padded with the character specified in APT_STRING_PADCHAR. You will therefore also need to convert both columns (only temporarily if necessary) to VarChar.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tagnihotri
Participant
Posts: 83
Joined: Sat Oct 28, 2006 6:25 am

Post by tagnihotri »

APT_STRING_PADCHAR, trim sometimes don't actually trim the collumns which are padded with funny characters (depending on the default value of the env variable). So better check the collumn data, which may not be actually same (i.e may be padded with these funny values) !!
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

I used the modify to convert the CHAR to VARCHAR. Is there a performance difference between the MODIFY and TRANSFORMER stage? Which is better to use?

Thanks
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

You dont need to specify anything for conversion between char and varchar. Or am i in the server frame of mind?

Its been time since i touched the parallel pallete.
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Lookup Stage - Multiple Keys

Post by Raftsman »

Is it possible to user to different key lookups in one lookup stage.

i.e. Field_A.input = B.Code_Table
Field_C.input = B.Code_Table

How do I join multiple fields to one Code table field.

Thanks
Post Reply