<?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: How to update a teradata table using SAS access? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/347130#M80138</link>
    <description>&lt;P&gt;Thank you Xia, &amp;nbsp;I hope you are keeping well.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;OR you could try PASS-THROUGH sql, but you need to know TD 's sql.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;proc sql;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;connect to teradata.......&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;execute (......)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;by teradata&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the understanding I needed. A TD sql in the execute did the job. I really &lt;STRONG&gt;appreciate&lt;/STRONG&gt; it. Take care!&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2017 17:39:05 GMT</pubDate>
    <dc:creator>CharlotteCain</dc:creator>
    <dc:date>2017-04-04T17:39:05Z</dc:date>
    <item>
      <title>How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346731#M79985</link>
      <description>&lt;P&gt;&lt;STRONG&gt;How to update a teradata table using SAS access&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two teradata tables:&lt;/P&gt;
&lt;P&gt;Table 1:&lt;/P&gt;
&lt;P&gt;Id &amp;nbsp; Col1 &amp;nbsp; &amp;nbsp;Col2&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp;g &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;h&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp;x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table 2:&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; Remark &amp;nbsp; &amp;nbsp;Date&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; complete &amp;nbsp; 02jan2004&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; pending &amp;nbsp; &amp;nbsp; 06jan2004&lt;/P&gt;
&lt;P&gt;2 &amp;nbsp; &amp;nbsp; complete &amp;nbsp; &amp;nbsp;08jan2005&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp;pending &amp;nbsp; &amp;nbsp; &amp;nbsp;08feb2005&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp;pending &amp;nbsp; &amp;nbsp; &amp;nbsp;07mar2005&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; pending &amp;nbsp; &amp;nbsp; &amp;nbsp;09mar2005&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I neeed the remark column with the max of date to be updated to table 1. Suppose if those were sas datasets, the code is pretty easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select a.*, b.remark&lt;/P&gt;
&lt;P&gt;from table1 a&lt;/P&gt;
&lt;P&gt;left join&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(select distinct id, remark, max(date) as max_date from table2&lt;/P&gt;
&lt;P&gt;group by id;&lt;/P&gt;
&lt;P&gt;having date=max_date) b&lt;/P&gt;
&lt;P&gt;on a.id=b.id;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I my tables are teradate tables, I find the &lt;STRONG&gt;SAS access execute statement&lt;/STRONG&gt; pretty challenging. Can anybody help?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 15:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346731#M79985</guid>
      <dc:creator>CharlotteCain</dc:creator>
      <dc:date>2017-04-03T15:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346801#M80011</link>
      <description>Have you tried UPDATE, MLOAD?&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346801#M80011</guid>
      <dc:creator>PatrickCuba</dc:creator>
      <dc:date>2017-04-03T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346903#M80039</link>
      <description>&lt;P&gt;I didn't try MLOAD. I have been trying UPDATE statement yes. I wonder whether it is possible to execute a teradata query using proc sql access. If yes, I just don't know how. I am unable to find some examples online.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 02:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346903#M80039</guid>
      <dc:creator>CharlotteCain</dc:creator>
      <dc:date>2017-04-04T02:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346923#M80043</link>
      <description>&lt;P&gt;Hi Charlotte,&lt;/P&gt;
&lt;P&gt;It is not called UPDATE table, it is more like JOIN table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you connected with TD you can manipulate it as sas table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname x tera .................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;CREATE TABLE X.NEW_TABLE AS&lt;/P&gt;
&lt;P&gt;select a.*, b.remark&lt;/P&gt;
&lt;P&gt;from X.table1 a&lt;/P&gt;
&lt;P&gt;left join&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(select distinct id, remark from X.table2&lt;/P&gt;
&lt;P&gt;group by id;&lt;/P&gt;
&lt;P&gt;having date=max(date)) b&lt;/P&gt;
&lt;P&gt;on a.id=b.id;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR you could try PASS-THROUGH sql, but you need to know TD 's sql.&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;connect to teradata.......&lt;/P&gt;
&lt;P&gt;execute (......)&lt;/P&gt;
&lt;P&gt;by teradata&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 04:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346923#M80043</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-04T04:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346928#M80044</link>
      <description>Like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; I'm confused when you talk about update when your SQL is a query.&lt;BR /&gt;Either way, it looks pretty straightforward so there's a chance that this will be an implicit pass through. &lt;BR /&gt;You could try perhaps on smaller tables first like in a test environment or so. &lt;BR /&gt;Add:&lt;BR /&gt;Options msglevel = I sastrace = ',,,d' SASTRACELOC = saslog nostsuffix; &lt;BR /&gt;which will reveal how the ACCESS engine will deal with the query.</description>
      <pubDate>Tue, 04 Apr 2017 05:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/346928#M80044</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-04-04T05:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a teradata table using SAS access?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/347130#M80138</link>
      <description>&lt;P&gt;Thank you Xia, &amp;nbsp;I hope you are keeping well.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;OR you could try PASS-THROUGH sql, but you need to know TD 's sql.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;proc sql;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;connect to teradata.......&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;execute (......)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;by teradata&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the understanding I needed. A TD sql in the execute did the job. I really &lt;STRONG&gt;appreciate&lt;/STRONG&gt; it. Take care!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 17:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-teradata-table-using-SAS-access/m-p/347130#M80138</guid>
      <dc:creator>CharlotteCain</dc:creator>
      <dc:date>2017-04-04T17:39:05Z</dc:date>
    </item>
  </channel>
</rss>

