Lookup Failure

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
askvishal
Participant
Posts: 8
Joined: Wed Oct 23, 2013 5:52 am
Location: Chennai

Lookup Failure

Post by askvishal »

Hi,
I am trying to do a lookup on Char and varchar columns. My job design is as follows:-

(DB1 --> Funnel <-- DB2) -->Transformer --> (Lookup <-- Seq File) --> DB Target

DB1 has Code (Char 3) and Scheme (Varchar 20) as Key columns
DB2 has Code (Char 3) and Scheme (Varchar 20) as Key colums.

DB2 however has char of length 2 as data.

The funnel has the output Code (Char 3) and Scheme (Varchar 20) as output along with other columns..

In the lookup, the Sequential file has both the Code and Scheme cols as Varchar 20..
The lookup works fine for the records of DB1, however fails for DB2..
The Code and Scheme Columns are however trimmed for DB2 in the source itself.

Please provide some suggestions to overcome the failure
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So DB2 fails because it is comparing "XX " to "XX" is what you are saying? If that's the case, then yes you do need to trim that source field but you need to ensure your target for the trim() function is a varchar. Trimming a char to a char is a waste of time as the datatype just automatically pads it back out.
-craig

"You can never have too many knives" -- Logan Nine Fingers
askvishal
Participant
Posts: 8
Joined: Wed Oct 23, 2013 5:52 am
Location: Chennai

Post by askvishal »

Thanks for the reply.. It worked.
Post Reply