<?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 proc sql update statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200483#M50048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attempting to update a field in my table that requires a join from another table as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update work.table_01 as t1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set t1.region = 'North'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from work.table_01 as t1 inner join work.table_02 as t2 on t1.ID = t2.ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t2.state in ('PA');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Received errors in the from clause and also read that SAS does not recgonize joins in the update statement.&amp;nbsp; Is there another way to write this proc sql or maybe adding a sub query (not sure where in the code) to get this to work?&amp;nbsp; If someone can provide an example based on above, that would be great as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 21:25:20 GMT</pubDate>
    <dc:creator>PhatRam33</dc:creator>
    <dc:date>2015-03-12T21:25:20Z</dc:date>
    <item>
      <title>proc sql update statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200483#M50048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attempting to update a field in my table that requires a join from another table as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update work.table_01 as t1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set t1.region = 'North'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from work.table_01 as t1 inner join work.table_02 as t2 on t1.ID = t2.ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t2.state in ('PA');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Received errors in the from clause and also read that SAS does not recgonize joins in the update statement.&amp;nbsp; Is there another way to write this proc sql or maybe adding a sub query (not sure where in the code) to get this to work?&amp;nbsp; If someone can provide an example based on above, that would be great as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 21:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200483#M50048</guid>
      <dc:creator>PhatRam33</dc:creator>
      <dc:date>2015-03-12T21:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql update statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200484#M50049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not always easy to do UPDATEs in SAS/SQL. But in this case, it is quite simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;update table_01&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set region = 'North'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where ID in (select ID from table_02 where state in ('PA'));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 22:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200484#M50049</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-03-12T22:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql update statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200485#M50050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did the trick! Thank you very much =D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-update-statement/m-p/200485#M50050</guid>
      <dc:creator>PhatRam33</dc:creator>
      <dc:date>2015-03-13T14:29:01Z</dc:date>
    </item>
  </channel>
</rss>

