Page 1 of 1

Dynamic lookup in DS

Posted: Mon May 31, 2010 12:05 pm
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!

Posted: Mon May 31, 2010 2:26 pm
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.

Posted: Mon May 31, 2010 2:32 pm
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? :?