SCD - Type 2 - Which columns should be Key?

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
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

SCD - Type 2 - Which columns should be Key?

Post by MrBlack »

I'm trying to figure out the Slowly Changing Dimension stage, specifically when dealing with a TYPE II. I can't figure out which column should be checked as the key column, especially when it comes to the three links that attach to the SCD.

Here's my best attempt to layout what my job looks like

Code: Select all

=====================================
Input Link     Key           Description - Stream coming in
------------------------------------------------------------------
Job_Id       Not Checked     Business Key
Job_Name     Not Checked     Type 2, monitor for changes
=====================================

=====================================
Lookup Link  Key                    Description - Reference link coming in
------------------------------------------------------------------
Dim_Key       Not Checked      Surrogate Key
Start_Dt      Not Checked      Effective Date (Type 2)
End_Dt        Not Checked      Expiration Date (Type 2)
Job_Id        Checked          Business Key
Job_Name      Checked          Type 2, monitor for changes
=====================================

=====================================
DTable UpSert Key                    Description - Output link
------------------------------------------------------------------
Dim_Key       Checked          Surrogate Key
Start_Dt      Not Checked      Effective Date (Type 2)
End_Dt        Not Checked      Expiration Date (Type 2)
Job_Id        Not Checked      Business Key
Job_Name      Not Checked      Type 2, monitor for changes
=====================================

=====================================
Fact Table - Not using it, just sending output to a peek stage for now
=====================================
With this setup the job will compile but when I try to run the job, I'm getting this error in the logs:

Code: Select all

main_program: Error when checking operator: Key field "JOB_CODE" was not found in the view-adapted input schema
Error when checking operator: Key field "Job_Name" was not found in the view-adapted input schema
Post Reply