SCD Stage-Compilation Error

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
ds_search2008
Participant
Posts: 75
Joined: Thu Nov 27, 2008 10:12 am

SCD Stage-Compilation Error

Post by ds_search2008 »

Hello all,

I'm trying to implement SCD-Type 2 using SCD stage. (Version 8.1).

Details:
Source, Reference and lookup - DB2 tables

source table has only one key column CUST_ID, generated by DB2.
Reference table is not defined with any key column. But as per the business rule,

Code: Select all

If
SourceTable.CUST_ID=ReferenceTable.ACCUNT_ID
then Update row in fact table
Else
Insert row into fact table
I tried to map source and reference columns using

SCD->Input tab-->Lookup tab
I have given the purpose code against CUST_ID--->ACCUNT_ID mapping as "Type 2". (Actually this is my current indicator column and key column as well)

I'm getting the compilation error

Code: Select all

"If at least one Type 2 column is present, then SCD stage requires either a Current Indicator column or an Expire Date column (or both) to be present in the dimension table!"
If I select Current Indicator option as the purpose code then I'm getting the following compilation error

Code: Select all

"If there are no SCD type 2 columns then SCD Type 2 current indicator, effective date and expire date columns must not be present!"
Is there any way to implement this scenario with the help of SCD stage! Could you kindly suggest me.

Many Thanks & Kind Regards
algfr
Participant
Posts: 106
Joined: Fri Sep 09, 2005 7:42 am

Re: SCD Stage-Compilation Error

Post by algfr »

ds_search2008 wrote:Hello all,

I'm trying to implement SCD-Type 2 using SCD stage. (Version 8.1).

Details:
Source, Reference and lookup - DB2 tables

source table has only one key column CUST_ID, generated by DB2.
Reference table is not defined with any key column. But as per the business rule,

Code: Select all

If
SourceTable.CUST_ID=ReferenceTable.ACCUNT_ID
then Update row in fact table
Else
Insert row into fact table
I tried to map source and reference columns using

SCD->Input tab-->Lookup tab
I have given the purpose code against CUST_ID--->ACCUNT_ID mapping as "Type 2". (Actually this is my current indicator column and key column as well)

I'm getting the compilation error

Code: Select all

"If at least one Type 2 column is present, then SCD stage requires either a Current Indicator column or an Expire Date column (or both) to be present in the dimension table!"
If I select Current Indicator option as the purpose code then I'm getting the following compilation error

Code: Select all

"If there are no SCD type 2 columns then SCD Type 2 current indicator, effective date and expire date columns must not be present!"
Is there any way to implement this scenario with the help of SCD stage! Could you kindly suggest me.

Many Thanks & Kind Regards
Two possibilities as far as I know :

- Only Type 1 : You just need a business key (your natural key) that you use for the lookup, a surrogate key (usually generated through a state file or a DB sequence) and a type 1 field to check the difference.

- Type 2 + Type 1 or pure Type 2 : Same but you need at least a Current indicator field that will be used to state which record is current.
algfr
Participant
Posts: 106
Joined: Fri Sep 09, 2005 7:42 am

Post by algfr »

Please note that the source structure and ref structure must be IDENTICAL for the SCD stage to perform. So you might rename one of these columns to get names to match.
Post Reply