Updating lookup file sets

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
rmrama
Participant
Posts: 26
Joined: Wed Oct 15, 2003 1:39 am

Updating lookup file sets

Post by rmrama »

Hello,

I'm curious to know if this is possible. I have a parallel job which does lookup using a Lookup stage. This stage take data from a Lookup Fileset, which is populated in a prior job.

I want to make a lookup, and move forward the following way:

1 - If matching key values are found, return value from another column (column X) available in the Lookup Fileset and carry on to the output stream of the Lookup stage.

2 - If matching key values are not found, take the rejected records and generate a column X value for each record and then carry on to do other things. At the same time, update the Lookup Fileset so that subsequent runs will not recreate the column X value.

Is this possible, and if yes how can i do it? I did this by inserting a routine into a Transformer to update hash files in Datastage Server.


Thanks in advance for your time!

Regards,
M. Ramanathan
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If the issue is only for the subsequent run, then the rejected records can be funneled with the current data which populates the lookup fileset and can be made to populate the lookup file set in the subsequent job.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To reinforce the point, no passive stage in a parallel job supports an output link AND an input link (not counting reject-handling). That is, you can not update the Lookup File Set in the same job in which you use it to provide reference values. So Kumar's solution, or something like it, is the only available solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rmrama
Participant
Posts: 26
Joined: Wed Oct 15, 2003 1:39 am

Post by rmrama »

Ray and Kumar, thank you both so much for your views.

If I get your inputs correctly, the best way would be for me to design the job in such a way that successful lookups (existing data) and rejects (new data, with new key values generated in Column X) are collected and re-written into the lookup fileset.

This is ok i guess, but i'm not sure how such a design will be helpful when the incoming data has duplicate rows. If duplicate rows come in within the same data source file and fails lookup, both rows will be rejected and assigned different Column X key values.

This is not what i want. My idea is to use the lookup fileset to return Column X values for records already available in the system, and generate new Column x values for new records coming into the system. For the example above, what would suite me is for the first occurrence of the reject to generate a new Column X value and persist in the lookup fileset and the second record to refer and pickup the newly created Column X value and move on.

Any view?

Regards,
M. Ramanathan.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can do all you like. The Lookup File Set stage has a property where you can elect to allow or disallow duplicate values. If you disallow, it supports another property that lets you specify how to handle "rejected rows".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rmrama
Participant
Posts: 26
Joined: Wed Oct 15, 2003 1:39 am

Post by rmrama »

Thanks Ray.

I couldnt read a big part of your replies, which is due to my choice of membership :cry: I'll try and make do with what understanding i got.

Thanks again!
Post Reply