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
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

SCD stage

Post by michaeld »

I'm trying to use the SCD stage to implement SCD2 logic. The issue I have is that a new surrogate key is generated for both updated records and new records. That is if a records is updated then the result is two record in the dimension update link:

1) entry to expire the old record with the SK and EXP_DT
2) entry to add the new updated record with all columns.


The issue is that for the updated record it doesn't keep the original key from the dimension lookup. It generates a new key. But a new key should ONLY be generated if the record was not found in the dimension lookup.

Is this yet another bug in the SCD stage or am I missing something?
Mike
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post by michaeld »

I just answered my own question.

It is a bug in the SCD stage:

even thought the dimension table is not displayed in the source column pane you can still access it through transformer script.

example:

if isNull(out_odbc_Products.PRODUCT_SK) then
NextSurrogateKey()
else
out_odbc_Products.PRODUCT_SK


It's actually kind of funny because when you type this in then datastage draws a column link going to an invisible table:-)
Mike
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does this bug still exist in version 8.1?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post by michaeld »

yes.
Mike
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:?
You said you were running 8.01. Probably it's 8.0.1.
This is not the same as 8.1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

I am working on 8.0 version and used SCD stage. Its is working fine for me and generating 2 records for type2, one with old SK for update and one with new SK for insert.
Nirdesh Kumar
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post by michaeld »

hi nirdesh2,

what do you have in the expression for the SK column on the Dim update tab?

Is it just NextSurrogateKey() or something else?
Mike
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

I am using NextSurrogateKey() in expression nothing else.
Nirdesh Kumar
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post by michaeld »

That's odd. I tried that initially and it didn't work. It would always generate a new SK. Maybe I'm missing some DataStage fix or patch or something.
Mike
rakbhaga
Participant
Posts: 1
Joined: Wed May 20, 2009 6:27 am
Location: chennai

Post by rakbhaga »

HiI tried Scd type 2 .it is working fine with file but not with database.It is having bug in 8.0.1. If anybody have implement with ODBC stage can help need urgently .
hiral.chauhan
Premium Member
Premium Member
Posts: 45
Joined: Fri Nov 07, 2008 12:22 pm

Post by hiral.chauhan »

I am using version 8.1.0, and I'm facing the same problem.

Does anybody know of a patch for this?

Thank you micheald !

~Hiral
Thanks,
Hiral Chauhan
Post Reply