Dynamic lookup in DS

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
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Dynamic lookup in DS

Post by vij »

Hi,

How can dynamic lookup be implemented in Datastage in a single job? I mean if there are 2 records in the source file/dataset which is looked up on a table and one inserted to table (same table as it was looked up on) as it is new (or the first one) and will the second record be updated to the table (in case columns other than key/lookup columns are different)...

I guess this will be possible by Insert else update option.. is this correct?

Please let me know, thanks!
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

The easiest way to do this is to remove duplicates in your processing stream so you only add one row to the lookup table. Use the Remove Duplicates stage, sort by a key field or a date field and take the first or last duplicate.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Unless they're not duplicates but rather a series of values that need to be applied in order. Then you would use... a sparse lookup? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply