Shared Container with 2 Natural Keys

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
JezT
Participant
Posts: 75
Joined: Wed Sep 15, 2004 1:52 am

Shared Container with 2 Natural Keys

Post by JezT »

I am using a shared container to look up a surrogate key for a given natural key. However, the problem is that the column in the source file which is used as a natural key relates to 2 different fields within the DB2 table in the shared container.

Therefore, depending on which row is being passed in, a different field within the table needs to be referenced in order to obtain the surrogate key.

At the moment I have created 2 Transform jobs, one passing in one of the natural key fields and the other passing in the second one. However, this is effecting performance as the source file is basically being used twice. Is there a way I can combine this into 1 job so that Datastage can tell which field is being passed in and therefore which field to reference on the table ?
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Re: Shared Container with 2 Natural Keys

Post by sumitgulati »

Try using a stage variable and in its description apply the logic to select one of the two different fields. Now pass the value of this stage variable to the shared container.

Thanks and Regards,
-Sumit
JezT wrote:I am using a shared container to look up a surrogate key for a given natural key. However, the problem is that the column in the source file which is used as a natural key relates to 2 different fields within the DB2 table in the shared container.

Therefore, depending on which row is being passed in, a different field within the table needs to be referenced in order to obtain the surrogate key.

At the moment I have created 2 Transform jobs, one passing in one of the natural key fields and the other passing in the second one. However, this is effecting performance as the source file is basically being used twice. Is there a way I can combine this into 1 job so that Datastage can tell which field is being passed in and therefore which field to reference on the table ?
Post Reply