<?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 How to update a same table using proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-same-table-using-proc-sql/m-p/856932#M338566</link>
    <description>&lt;P&gt;Hello Members,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help in understanding , How can we update table same table after join in proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table &lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable&lt;/STRONG&gt;&lt;BR /&gt;select p.*, e.time_id as start_dt_sk&lt;BR /&gt;from &lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable.&lt;/STRONG&gt; p ,&lt;BR /&gt;&amp;amp;plan_lib..t_&amp;amp;inputTable._end e&lt;BR /&gt;where &lt;BR /&gt;p.%bquote(&amp;amp;time_dim.) between e.start_date and e.end_date;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ignore macro variable these are getting resolved perfectly. My doubt is can we create table like these where from table name and create table is same ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do we have replace option here in proc sql ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;&lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable. &lt;/STRONG&gt;table is having larger volume&amp;nbsp;of records around&amp;nbsp;17M. Please help me with best possible way to resolve this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 20:22:49 GMT</pubDate>
    <dc:creator>Aexor</dc:creator>
    <dc:date>2023-02-02T20:22:49Z</dc:date>
    <item>
      <title>How to update a same table using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-same-table-using-proc-sql/m-p/856932#M338566</link>
      <description>&lt;P&gt;Hello Members,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help in understanding , How can we update table same table after join in proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table &lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable&lt;/STRONG&gt;&lt;BR /&gt;select p.*, e.time_id as start_dt_sk&lt;BR /&gt;from &lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable.&lt;/STRONG&gt; p ,&lt;BR /&gt;&amp;amp;plan_lib..t_&amp;amp;inputTable._end e&lt;BR /&gt;where &lt;BR /&gt;p.%bquote(&amp;amp;time_dim.) between e.start_date and e.end_date;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ignore macro variable these are getting resolved perfectly. My doubt is can we create table like these where from table name and create table is same ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do we have replace option here in proc sql ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;&lt;STRONG&gt;&amp;amp;lbname..&amp;amp;inputTable. &lt;/STRONG&gt;table is having larger volume&amp;nbsp;of records around&amp;nbsp;17M. Please help me with best possible way to resolve this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 20:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-same-table-using-proc-sql/m-p/856932#M338566</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2023-02-02T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a same table using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-same-table-using-proc-sql/m-p/856937#M338568</link>
      <description>&lt;P&gt;Normal SAS is probably smart enough to do that.&amp;nbsp; What is does when you are creating a NEW dataset like that is write the dataset first.&amp;nbsp; Then when it finishes writing successfully it deletes the old one and renames what it just wrote to the desired name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if &amp;amp;LBNAME is a libref that is defined using SAS/Access to some external database then you have to worry about what that database allows.&amp;nbsp; Most will not let you create a dataset with the same name as an existing dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 20:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-same-table-using-proc-sql/m-p/856937#M338568</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-02-02T20:44:10Z</dc:date>
    </item>
  </channel>
</rss>

