<?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: PROC SQL - UPDATE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306146#M270521</link>
    <description>&lt;P&gt;Sorry, it has some PHI information to provide &amp;nbsp;actual code from the log, so i just changed them to example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update dbms.&amp;amp;MyTable(dbkey=XYZ) A&lt;/P&gt;&lt;P&gt;993 SET&lt;BR /&gt;994 A.temp1= (SELECT B.temp1 &amp;nbsp;FROM MANUAL_TEMP B&lt;BR /&gt;_&lt;BR /&gt;73&lt;BR /&gt;76&lt;BR /&gt;ERROR 73-322: Expecting an =.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking into,&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2016 01:50:01 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2016-10-21T01:50:01Z</dc:date>
    <item>
      <title>PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306103#M270519</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to update the Oracle table with SAS dataset contents with some merge conditions &amp;amp; queried as belwo and getting error message as &amp;nbsp;ERROR 73-322: Expecting an =. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS dataset -&amp;nbsp;&lt;SPAN&gt;MANUAL_TEMP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Oracle table -&lt;SPAN&gt;dbms.oracle_table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname dbms oracle user=CCCC password= AAAA path= BBBB schema=xyz;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;update dbms.oracle_table(dbkey=XYZ) A&lt;BR /&gt;SET&lt;BR /&gt;A.test_date = (SELECT B.test_date FROM MANUAL_TEMP B&lt;BR /&gt;WHERE&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6),&lt;BR /&gt;A.test_upload = (SELECT B.test_upload FROM MANUAL_TEMP B&lt;BR /&gt;WHERE&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6),&lt;BR /&gt;A.test_reason = (SELECT B.test_reason FROM MANUAL_TEMP B&lt;BR /&gt;WHERE&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6),&lt;BR /&gt;A.test_exclusion = (SELECT A.test_exclusion || '|' || B.test_exclusion FROM MANUAL_TEMP B&lt;BR /&gt;WHERE&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6)&lt;BR /&gt;where exists (&lt;BR /&gt;select 1&lt;BR /&gt;from MANUAL_TEMP B&lt;BR /&gt;where&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6);&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 21:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306103#M270519</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2016-10-20T21:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306126#M270520</link>
      <description>&lt;P&gt;Post the code from log along with the error message. It will help if you paste it into the box opened by clicking on the "run" icon at the top of you message to preserve formatting as the _ character shows exactly where the unexpected value appears.&lt;/P&gt;
&lt;P&gt;Note that may not be the cause of the error as missing or extra semicolons or commas before that line may be the actual cause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 23:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306126#M270520</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-20T23:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306146#M270521</link>
      <description>&lt;P&gt;Sorry, it has some PHI information to provide &amp;nbsp;actual code from the log, so i just changed them to example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update dbms.&amp;amp;MyTable(dbkey=XYZ) A&lt;/P&gt;&lt;P&gt;993 SET&lt;BR /&gt;994 A.temp1= (SELECT B.temp1 &amp;nbsp;FROM MANUAL_TEMP B&lt;BR /&gt;_&lt;BR /&gt;73&lt;BR /&gt;76&lt;BR /&gt;ERROR 73-322: Expecting an =.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking into,&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 01:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306146#M270521</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2016-10-21T01:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306151#M270522</link>
      <description>&lt;P&gt;You can use the following options to see what kind of sql SAS passed to Oracle and debug it from there.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace=',,,d' sastraceloc=saslog;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Oct 2016 02:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306151#M270522</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-21T02:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306152#M270523</link>
      <description>&lt;P&gt;I tried adding that, but It didnt help me much to trace where it is going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 02:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306152#M270523</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2016-10-21T02:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306156#M270524</link>
      <description>&lt;P&gt;Can you remove &amp;nbsp;"(dbkey=id)" ?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 02:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306156#M270524</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-21T02:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306158#M270525</link>
      <description>Thanks for the suggestion , But Still the same error.</description>
      <pubDate>Fri, 21 Oct 2016 02:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306158#M270525</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2016-10-21T02:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306161#M270526</link>
      <description>&lt;P&gt;I know what is going on , Remove 'A.' from the variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;993 SET&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;994 A.temp1= (SELECT B.temp1 &amp;nbsp;FROM MANUAL_TEMP B&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;----&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;993 SET&lt;BR /&gt;&lt;SPAN&gt;994&lt;STRONG&gt; temp1&lt;/STRONG&gt;= (SELECT &lt;STRONG&gt;temp1&lt;/STRONG&gt; &amp;nbsp;FROM MANUAL_TEMP B&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 02:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306161#M270526</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-21T02:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306163#M270527</link>
      <description>That really worked !!! Thanks much for helping me out, learned something new today.&lt;BR /&gt;&lt;BR /&gt;Thanks Again</description>
      <pubDate>Fri, 21 Oct 2016 03:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/306163#M270527</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2016-10-21T03:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347366#M270528</link>
      <description>&lt;P&gt;I am using the following query to update a table . Can you please help why we are using exists here? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where exists (&lt;BR /&gt;select 1&lt;BR /&gt;from MANUAL_TEMP B&lt;BR /&gt;where&lt;BR /&gt;A.temp1 = B.temp1&lt;BR /&gt;AND A.temp2 = B.temp2&lt;BR /&gt;AND A.temp3 = B.temp3&lt;BR /&gt;AND A.temp4 = B.temp4&lt;BR /&gt;AND A.temp5 = B.temp5&lt;BR /&gt;AND A.temp6 = B.temp6);&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 14:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347366#M270528</guid>
      <dc:creator>suraj</dc:creator>
      <dc:date>2017-04-05T14:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347387#M270529</link>
      <description>&lt;PRE&gt;

exist(...) will return TRUE if you can SELECT ANY obs from that condition.

WHERE  means update the obs which satisfy that condition ( exist will return TRUE).


&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Apr 2017 14:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347387#M270529</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-05T14:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347637#M270530</link>
      <description>&lt;P&gt;Thanks a lot for help.. it worked for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just curious to know why we are using where again when we are already using it in subquery.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also used it in same way and it's working for me. but just wants to clear my doubt. Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 09:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347637#M270530</guid>
      <dc:creator>suraj</dc:creator>
      <dc:date>2017-04-06T09:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL - UPDATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347678#M270531</link>
      <description>&lt;P&gt;I also confused before.&lt;/P&gt;
&lt;P&gt;WHERE clause here is to update sub-dataset,&lt;/P&gt;
&lt;P&gt;if you don't specify WHERE then SQL will update all the obs.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 12:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-UPDATE/m-p/347678#M270531</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-06T12:34:59Z</dc:date>
    </item>
  </channel>
</rss>

