SCD Design

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

SCD Design

Post by Raftsman »

I am trying to get the following design working and please need some help

I have one main input stream and one reference (DIM table). If no records exist in the main stream and 1 exists in the dimension, I want to set the dimensional record expiry date. I selected one business key and many type 2 keys as the lookup. None get processed.

Can the SCD stage handle this and if so, could someone point me in the right direction. Again, the documentation is very poor on this.[/img]
Jim Stewart
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

If anything, I don't think the Lookup is working in the SCD. It's difficult to determine. I simplified the process with Peek stages and still no comparison. As usual, the learning curve grows....
Jim Stewart
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

I don't think you can achieve your goal easily. I don't know much of the mechanics behind this stage, but I would assume your stage would need a streaming input of rows to match the rows in the SCD target table.

I would guess you would need to determine which dimension natural keys don't exist in the first input stream of facts. Something like:

select dim_natural_key from dim_target where dim_natural_key not in (select dim_natural_key from fact_source). Those rows are the ones to be retired, then I would suggest you see if the SCD stage can retire without creating a new variant. If not you'll just have to do this the old fashioned way and update the most recent rows for those natural keys.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply