<?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 target table with another source table using partial variables in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/update-target-table-with-another-source-table-using-partial/m-p/629877#M18863</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data target;
	update target renew;
	by id1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update Statement will meet your requirements :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. It Does not update the value in the master by default, if the transaction table has missing values.&lt;/P&gt;
&lt;P&gt;2. Sets to missing if both master and transaction have missing values&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 16:56:46 GMT</pubDate>
    <dc:creator>r_behata</dc:creator>
    <dc:date>2020-03-05T16:56:46Z</dc:date>
    <item>
      <title>update target table with another source table using partial variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/update-target-table-with-another-source-table-using-partial/m-p/629873#M18862</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to learn how to update a target table with values from another table. There are about 1000 variables in the target table and only about 350 variables (chat or num variables) need to be updated from a renew dataset. The rules are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the renew dataset has value in the variables then use that value in the target dataset.&lt;/LI&gt;&lt;LI&gt;If the renew dataset has missing value then keep the value in the target dataset.&lt;/LI&gt;&lt;LI&gt;If both target and renew datasets have missing value then keep the value as missing.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have generated a very simple example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data target;&lt;BR /&gt;input id1$ id2 a b c$ d$ e f;&lt;BR /&gt;datalines;&lt;BR /&gt;1 10 6 8 x1 x2 9 3&lt;BR /&gt;2 20 5 . y1 . 6 .&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data renew;&lt;BR /&gt;input id1$ id2 a b c$ d$ e f;&lt;BR /&gt;datalines;&lt;BR /&gt;1 . 6 8 x10 . 9 30&lt;BR /&gt;2 20 . 3 . y20 6 .&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the data want will be&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;id1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;id2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;a&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;b&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;c&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;d&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;e&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;f&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;x10&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;x2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;30&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;y1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;y20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 16:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/update-target-table-with-another-source-table-using-partial/m-p/629873#M18862</guid>
      <dc:creator>CHL0320</dc:creator>
      <dc:date>2020-03-05T16:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: update target table with another source table using partial variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/update-target-table-with-another-source-table-using-partial/m-p/629877#M18863</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data target;
	update target renew;
	by id1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update Statement will meet your requirements :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. It Does not update the value in the master by default, if the transaction table has missing values.&lt;/P&gt;
&lt;P&gt;2. Sets to missing if both master and transaction have missing values&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 16:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/update-target-table-with-another-source-table-using-partial/m-p/629877#M18863</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2020-03-05T16:56:46Z</dc:date>
    </item>
  </channel>
</rss>

