How to refresh a lookup in every job iteration

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
yserrano
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 31, 2008 1:23 pm
Location: Santo Domingo

How to refresh a lookup in every job iteration

Post by yserrano »

Hello all, please excuse me if this is a newbie question, I am actually new to DataStage development.

Is it possible to refresh a lookup to reflect inserts done to the lookup table within the same job?
My job writes records to a table X, It is capable of insert new records, insert new versions and update old versions of existing records. The lookup to identify existing records and new versions is done to the same table X. The problem arises because the input data may have several versions of the same record inside.

This question was probably asked before here, please point me out the right keywords to include in a search for similar situations.

Thank you

Yonny Serrano
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your reference lookup is done to an actual database table or a hashed file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
yserrano
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 31, 2008 1:23 pm
Location: Santo Domingo

Post by yserrano »

to a database table
(the same table I am inserting and updating records into)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That makes it problematic as you'd need to commit every record to make them available to the lookup. A hashed file solution is simple - write the new records to the same hashed file and don't cache the lookup.
-craig

"You can never have too many knives" -- Logan Nine Fingers
yserrano
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 31, 2008 1:23 pm
Location: Santo Domingo

Post by yserrano »

mmm... :? it seems that I'll have to sign up for the Premium Membership to see your complete answer.
Let me see if my boss wants to authorize that expense.

Regards,

YS
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You couldn't have missed much... check again.

However, the 'expense' is well worth it. Not only are you helping support the site that helps support you, but from what I'm told there's more goodies on the way for Premium Members. Not only that, but you'd get full access to all of the Wurlod Goodness available here! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
SHARAD123
Premium Member
Premium Member
Posts: 54
Joined: Wed Jan 09, 2008 12:05 am

Post by SHARAD123 »

hi,
y cant u try using a stage the update the lookup table after every iteration or b4 the lookup actually starts.

That should be an easy way i guess....

jus revert if there is anyother idea
222102
yserrano
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 31, 2008 1:23 pm
Location: Santo Domingo

Post by yserrano »

I am working right now on the "Hash-Files" approach, and it seems like it is going to work. But I am curious about SHARAD post.
It would be nice if he (she) could develop a little more into his (her) idea.

This is how my original server job looks like:

Image

BTW, Thank you for your help.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The hashed file approach is bog standard DataStage Server stuff. Replace your two ODBC lookup stages with hashed file stages (and build something to do the initial population, if needed) and you'll be fine. As noted, make sure the hashed lookup is either not cached (my personal preference) or set to 'Locked for updates'.

As to the SHARAD123 suggestion, right now it is fairly incomprehensible. I too would be curious as to what the actual suggestion would be, once clarified.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not cached AND set for "lock for updates" would be my suggestion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply