<?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: Update Table from another Table deppending of two Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164319#M300336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; UPDATE LIB.CI_CONTACT_HISTORY_C_EXTENDED T1 SET LAST_CONTACT_DT = &amp;amp;FECHA. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; WHERE EXISTS (SELECT * FROM EXIST WHERE CUSTOMER_ID=T1.CUSTOMER_ID AND CONTACT_DT&amp;nbsp; = DATEPART(T1.END_MANAGEMENT_DT));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Nov 2014 19:09:33 GMT</pubDate>
    <dc:creator>DBailey</dc:creator>
    <dc:date>2014-11-10T19:09:33Z</dc:date>
    <item>
      <title>Update Table from another Table deppending of two Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164318#M300335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi community...&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I need to resolve this very quickly.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I established an extended table for CONTACT_HISTORY table of Customer Intelligence Common Data Model. I want to update a variable, this is LAST_CONTACT_DT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;HERE IS THE EXTENDED TABLE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;CELL_PACKAGE_SK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMBER(10) NOT NULL ,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;CAMPAIGN_CD NVARCHAR2(30) NOT NULL,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;CUSTOMER_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMBER(10) NOT NULL ,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;LAST_CONTACT_DT DATE NOT NULL,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;CICLO_ID NVARCHAR2(2) NOT NULL,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;END_MANAGEMENT_DT DATE NOT NULL&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;For each occurrence for every communication for some campaign, if the Customer exist, i need to update the value of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;First, I try this...&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; UPDATE LIB.CI_CONTACT_HISTORY_C_EXTENDED SET LAST_CONTACT_DT = &amp;amp;FECHA. WHERE CUSTOMER_ID IN (SELECT CUSTOMER_ID FROM EXIST);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;That code, update the value for each Customer in the table, but for each campaign (CAMPAIGN_CD) that the customer exist. I only need to update the variable which contain the same END_MANAGEMENT_DT f the campaign that is being processed .. so.. I posed the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;UPDATE LIB.CI_CONTACT_HISTORY_C_EXTENDED SET LAST_CONTACT_DT = &amp;amp;FECHA.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FROM LIB.CI_CONTACT_HISTORY_C_EXTENDED&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN WORK.EXIST EXISTS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; ON EXTENDED.CUSTOMER_ID = EXISTS.CUSTOMER_ID AND&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; DATEPART(EXTENDED.END_MANAGEMENT_DT) = EXISTS.CONTACT_DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;QUIT; /*The datepart function is required. WORK is SAS Code and the extended table is ORACLE Schema.*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;But this, doesn´t work.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Has anybody knows how to do that? How to realice an update from inner join between this tables: which contains the Customers in the occurrence of the communication and the table which contains that customers for the last occurrence of the previous communication.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 18:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164318#M300335</guid>
      <dc:creator>Cristian_SAS</dc:creator>
      <dc:date>2014-11-10T18:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update Table from another Table deppending of two Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164319#M300336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; UPDATE LIB.CI_CONTACT_HISTORY_C_EXTENDED T1 SET LAST_CONTACT_DT = &amp;amp;FECHA. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; WHERE EXISTS (SELECT * FROM EXIST WHERE CUSTOMER_ID=T1.CUSTOMER_ID AND CONTACT_DT&amp;nbsp; = DATEPART(T1.END_MANAGEMENT_DT));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; background-color: #ffffff;"&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 19:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164319#M300336</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-11-10T19:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update Table from another Table deppending of two Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164320#M300337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excelente... Muchas Gracias por el aporte...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 19:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-Table-from-another-Table-deppending-of-two-Variables/m-p/164320#M300337</guid>
      <dc:creator>Cristian_SAS</dc:creator>
      <dc:date>2014-11-10T19:25:01Z</dc:date>
    </item>
  </channel>
</rss>

