<?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 convert the SQL update statement to SAS update statement? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340581#M10117</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124089"&gt;@Jade_SAS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this update query work in SAS/SQL? The documentation doesn't include the possibility of a from clause in an update query.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 20:51:33 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-03-13T20:51:33Z</dc:date>
    <item>
      <title>How to convert the SQL update statement to SAS update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340531#M10110</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have trouble to convert the following SQL update statement to SAS Update statement, could you please help me with this? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SQL update statement:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;update&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; TableA&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; InstituteID = LocationID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;FROM TableA as f&lt;/P&gt;&lt;P&gt;LEFT JOIN TableB as d ON f.MainLocation = d.LocationName&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;WHERE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; InstituteID is NULL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340531#M10110</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-03-13T18:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the SQL update statement to SAS update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340535#M10111</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=tablea;
by mainlocation;
run;

proc sort data=tableb;
by locationname;
run;

data tablea;
merge
  tablea (in=a)
  tableb (in=b rename=(locationname=mainlocation))
;
by mainlocation;
if a;
if b and missing(instituteid ) then instituteid = locationid;
drop locationid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The success depends on the relationship between the tables with regards to the key variable (1:1, 1:n, m:1, m:n).&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340535#M10111</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-13T18:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the SQL update statement to SAS update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340546#M10116</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340546#M10116</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-03-13T18:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the SQL update statement to SAS update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340581#M10117</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124089"&gt;@Jade_SAS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this update query work in SAS/SQL? The documentation doesn't include the possibility of a from clause in an update query.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 20:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-the-SQL-update-statement-to-SAS-update-statement/m-p/340581#M10117</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-03-13T20:51:33Z</dc:date>
    </item>
  </channel>
</rss>

