0 / 0
Editing a DataStage Slowly Changing Dimension stage

Editing a DataStage® Slowly Changing Dimension stage

To edit a Slowly Changing Dimension (SCD) stage, you must define how the stage looks up data in the dimension table, obtains surrogate key values, updates the dimension table, and writes data to the output link.

Before you edit the SCD stage, you must edit the stages on the input links:
  • In the source stage, specify the file name for the data source and define the column metadata. Verify that the source data is sorted correctly.
  • In the dimension reference stage, specify the table name and connection properties for the dimension table, and define the column metadata.
  1. Open the SCD stage properties panel.
  2. On the Stage tab, in the Properties section, select the output link.
    By default the first output link that you connect to the SCD stage is set as the output link.
  3. On the Input tab, define the input data to the stage:
    1. Select the reference link in the Input name field.
    2. In the Lookup section, click Edit. The Edit lookup page opens.
    3. Open the drop-down list in one row of the Purpose column and select a value. Then, in the same row, select a value in the Key Expression column.
    4. If you are using a Surrogate Key Generator stage to maintain the key source, specify information about the key source by clicking in the Purpose column of the row that has the key source, then selecting "Surrogate key".
    5. In the Purpose column, select appropriate values for the rest of the rows. Then, click Apply and return.
    6. In the Surrogate key section, specify the necessary information, then click Save.
  4. On the Output tab, define the output data from the stage:
    1. If the stage has multiple output links, select the link that you want to configure from the drop-down list. If the stage has one output link, go to the next step.
    2. In the Columns section, click Edit.
    3. On the Edit columns page, create column derivations to specify how to detect and apply changes to dimension records.
    4. On the Output Map tab, map data from the input links to the output link.
  5. Click Save.
After you edit the SCD stage, you must edit the stages on the output links:
  • If you are updating the dimension table in the current job, specify the name and connection properties for the dimension table, set the Write method property to Upsert, and set the Upsert Mode property to Auto-generated Update & Insert. You do not need to define column metadata because the SCD stage propagates the column definitions from the dimension reference link to the dimension update link.
  • If you are loading the fact table in the current job, specify the table name and connection properties for the target database, and select any write method. The column metadata is already defined by the mappings that you specified in the SCD stage.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more