Creating History records using SCD stage

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
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

Creating History records using SCD stage

Post by nikhil_bhasin »

I have a scenario in which we will need to create history of a given record(based on some key) of the change of the status code:-

Input:-

key,status_cd,change_dt
1,C,2012-05-25
1,D,2012-05-29


Output:-

Key,status_cd,change_dt,effect_dt
1,C,2012-05-28,2012-05-25
1,D,9999-12-31,2012-05-29

Problem is there is no refernce history available, all the records are coming in a single input file and I have to generate change_dt and effect_dt for a given status_cd as shown in example.

Any thoughts on how it can be done using SCD stage?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a word, "automatically". Date management is part of regular Type 2 SCD processing using this stage. You can also set a "current" indicator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

Post by nikhil_bhasin »

Found a workaround using transformer and reducing some redundant requirements.
Post Reply