Can This Be Possible With Out SCD?

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
knip1
Participant
Posts: 5
Joined: Tue Nov 30, 2010 11:57 am

Can This Be Possible With Out SCD?

Post by knip1 »

Hi Experts,
Requirement:
i want to update a record in the table based on the record from the source.
my table basically has 3 columns
identity,datestart,dateend,flag
1 2010-01-31 9999-12-31 M
if iam getting a record frm file say
identity datestart flag
1 2010-02-28 T
Then the record in the table should be
Identifier,datestart,datend,flag
1 2010-01-31 2010-02-28 M
1 2010-02-28 9999-12-31 T

can i impement this with out using SCD?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, basically using Lookup and Transformer stages. The logic is contained within the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
knip1
Participant
Posts: 5
Joined: Tue Nov 30, 2010 11:57 am

Post by knip1 »

Ray Thanks For Reply,
Can you please elaborate on the logic
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Set the Lookup Failed rule to Continue.
In the Transformer stage detect success or failure of the lookup with an IsNull() function.
If the lookup fails, your new record goes to an Insert link.
If the lookup succeeds, your new record goes to an Insert link and the columns returned from the Lookup go to an Update link, with appropriate column derivation expressions.
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