<?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 Overwrite or update Impala table using sas in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395460#M66463</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a daily incremental code for Impala tables in SAS with Proc Append. But if I execute proc append twice or multiple time so the data gets appended multiple time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I avoide this replication of data. Or else, is there any way to overwrite or update the data in impala table using sas.&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rahul&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2017 10:39:50 GMT</pubDate>
    <dc:creator>Rahul_SAS</dc:creator>
    <dc:date>2017-09-13T10:39:50Z</dc:date>
    <item>
      <title>Overwrite or update Impala table using sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395460#M66463</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a daily incremental code for Impala tables in SAS with Proc Append. But if I execute proc append twice or multiple time so the data gets appended multiple time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I avoide this replication of data. Or else, is there any way to overwrite or update the data in impala table using sas.&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Rahul&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 10:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395460#M66463</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-09-13T10:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite or update Impala table using sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395466#M66464</link>
      <description>&lt;P&gt;Assuming you have SAS/ACCESS to Impala there are lots of ways - you can use a data step merge to update existing records and add any new ones at the same time, Proc SQL Union to append, data step Update statement etc.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 10:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395466#M66464</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-09-13T10:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite or update Impala table using sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395467#M66465</link>
      <description>&lt;P&gt;I use two different ways to avoid duplicate data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- set a variable that identifies a group of new records. This can be an infile name, a date, or similar. While concatenating (I do not use proc append), observations with the same values as those that are to be appended are excluded from the master dataset.&lt;/P&gt;
&lt;P&gt;- identify a unique key (this may be one or more variables). After appending/concatenating, do a proc sort with nodupkey.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 10:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395467#M66465</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-13T10:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite or update Impala table using sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395478#M66466</link>
      <description>&lt;P&gt;hi KurtBremser....could you please share a sample code for the first scenario.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 11:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395478#M66466</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2017-09-13T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite or update Impala table using sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395488#M66467</link>
      <description>&lt;P&gt;A piece of blueprint code might look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let infile1=/shared/data/data_20170913.dat;
%let outlib=out;
%let masterfile=my_dataset;

data infile;
infile "&amp;amp;infile1";
input
  indata $
;
todays_file = "&amp;amp;infile1";
run;

data &amp;amp;outlib..&amp;amp;masterfile._new;
set
  &amp;amp;outlib..&amp;amp;masterfile (where=(todays_file ne "&amp;amp;infile1"))
  infile
;
run;

proc datasets library=&amp;amp;outlib nolist;
delete &amp;amp;masterfile;
change &amp;amp;masterfile._new=&amp;amp;masterfile;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that I do the "append" in a separate step. That way I can wrap the final proc datasets into a macro that checks for &amp;amp;syscc=0, to prevent replacing the master dataset if anything went wrong.&lt;/P&gt;
&lt;P&gt;Also note that this is a SAS-only solution; you may have to check your options with the administrators of the Impala DBMS.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 12:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overwrite-or-update-Impala-table-using-sas/m-p/395488#M66467</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-13T12:19:44Z</dc:date>
    </item>
  </channel>
</rss>

