<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue with SCD Type 2 in SAS Data Integration Studio (SAS DIS) in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Issue-with-SCD-Type-2-in-SAS-Data-Integration-Studio-SAS-DIS/m-p/476187#M14919</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/63520"&gt;@imdickson&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;SCD2 change tracking will maintain history for values under change tracking which change within the same business key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand what you describe right then if the value of&amp;nbsp;&lt;SPAN&gt;Electric_Tag&lt;/SPAN&gt; changes the value of&amp;nbsp;&lt;SPAN&gt;Electric_Name&lt;/SPAN&gt; changes as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Electric_Name is part of your business key so you end up with a new business key and not with a change to an existing business key.&lt;/P&gt;
&lt;P&gt;For this reason the SCD2 loader will treat this as a totally new record (insert) without expiring (update) an already existing record (which has a different business key).&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jul 2018 05:20:19 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-07-07T05:20:19Z</dc:date>
    <item>
      <title>Issue with SCD Type 2 in SAS Data Integration Studio (SAS DIS)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Issue-with-SCD-Type-2-in-SAS-Data-Integration-Studio-SAS-DIS/m-p/475565#M14906</link>
      <description>&lt;P&gt;Hello everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS Data Integration Studio. Here is the thing.&lt;/P&gt;&lt;P&gt;In one of the job, I am using SCD Type 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; source&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; ElectricTag  Electric_RK  PanName PanRK &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt; &lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;2009-AAA 100 USA 50&lt;BR /&gt;2010-AAA 101 USA 50
2011-AAA 102 UK  51
2011-BBB 103 POL 52
2011-CCC 104 UKR 53&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The business key is ElectricTag and PanName.&amp;nbsp; When i say Business key, I am referring to the primary key which is the ElectricTag and PanName.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The target table will have 2 additioinal column&lt;/P&gt;&lt;P&gt;1) Valid_from- Capture the datetime now for any new records&lt;/P&gt;&lt;P&gt;2) Valid_to-Capture the datetime now for any expired/obsoleted records&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The scenario is, whenever the newer set of data source comes in, for example, a new ElectricTag called 2011-CCD 105 with the same PanName&amp;nbsp; UKR 53, but the new source doesn't have 2011-CCC anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, i would expect the record below&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token data string"&gt;2011-CCC 104 UKR 53&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;have Valid_to with today's datetime to indicate this record is no more valid for use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile, the record below&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token data string"&gt;2011-CCD 105 UKR 53&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;should have valid_from with today's datetime to indicate this record is valid for use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, my settings for SCD Type 2 doesnt work properly. nothing will be changed at the moment. I need your kind advice based on my SCD Type 2 settings below:&lt;/P&gt;&lt;P&gt;Business Key tab:&lt;BR /&gt;Electric_Name&lt;/P&gt;&lt;P&gt;Pan_CD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Detech changes tab:&lt;/P&gt;&lt;P&gt;Electric_Tag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P/S: Electric_name=Electric_tag but with different variable name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your advice to fulfill the mentioned criteria.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 10:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Issue-with-SCD-Type-2-in-SAS-Data-Integration-Studio-SAS-DIS/m-p/475565#M14906</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-07-05T10:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with SCD Type 2 in SAS Data Integration Studio (SAS DIS)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Issue-with-SCD-Type-2-in-SAS-Data-Integration-Studio-SAS-DIS/m-p/476187#M14919</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/63520"&gt;@imdickson&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;SCD2 change tracking will maintain history for values under change tracking which change within the same business key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand what you describe right then if the value of&amp;nbsp;&lt;SPAN&gt;Electric_Tag&lt;/SPAN&gt; changes the value of&amp;nbsp;&lt;SPAN&gt;Electric_Name&lt;/SPAN&gt; changes as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Electric_Name is part of your business key so you end up with a new business key and not with a change to an existing business key.&lt;/P&gt;
&lt;P&gt;For this reason the SCD2 loader will treat this as a totally new record (insert) without expiring (update) an already existing record (which has a different business key).&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2018 05:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Issue-with-SCD-Type-2-in-SAS-Data-Integration-Studio-SAS-DIS/m-p/476187#M14919</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-07T05:20:19Z</dc:date>
    </item>
  </channel>
</rss>

