How to expire the old record

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
Ratan Babu N
Participant
Posts: 34
Joined: Tue Dec 27, 2005 12:13 am

How to expire the old record

Post by Ratan Babu N »

Hi,
I have an issue in expiring the old record ( SCD type2)

for me if a record fails on certain lookups then i dont process that particular record. If that record fails for a couple of days and update comes on that record (means the old record as well as this record all are new) so before inserting the new record, i have to expire the old record which is not existing in the warehouse at all.

For eg: Record A fails on Day 1 and Day2
Record B fails on Day 2
Records A,B and C Succeds on Day3. So before inserting C, I have to Expire B with Fileheader Date of C and Before Inserting B , I have to Expire A with File Header Date of B.(surrogate key is same but only Process time is different for all these). As all these 3 records are inserting on the same day, How can I achieve this in a Transformer Stage )

I used 3 stage variables and Transformer operating in a sequential mode
sv1 : it will take the natural key of incoming record

sv2 : If sv1 = sv3 then Fileheader Date else high date

sv3 : it will take the natural key of incoming record

But in this way, I am not getting the File header date of previous record. how to catch the File header date of previous record instead of processing record.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If it's Type 2 SCD there is no such thing as "update the previous record". The old record is expired as soon as any update comes through. In that way history can be re-built as required, which is the point of Type 2 SCD. The remainder of your question is therefore moot.
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