<?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 not working with IN keyword in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584373#M166441</link>
    <description>&lt;P&gt;It should work. Make sure the IDs are exactly the same in both tables. Watch for leading spaces or zeros if the IDs are character, or fields that differ but look the same only because of formats.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2019 21:21:35 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-08-27T21:21:35Z</dc:date>
    <item>
      <title>Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584369#M166437</link>
      <description>&lt;P&gt;Hey everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table, TEST, and I want to update the TEST.status =&amp;nbsp; "submitted" if TEST.ID exists in another table I have of IDs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote this code below in proc sql but for some reason the IN keyword wont highlight and I am not getting the expected result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update work.test&lt;BR /&gt;set status = "submitted"&lt;BR /&gt;where id in&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (select ID from work.list_of_IDs);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It runs without errors but I get the note that no rows have been updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone knows what is going wrong or can offer a solution I would really appreciate it, I have been struggling with this for some time now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584369#M166437</guid>
      <dc:creator>gmuersch</dc:creator>
      <dc:date>2019-08-27T21:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584371#M166439</link>
      <description>&lt;P&gt;"highlight"?&amp;nbsp; Are you talking about something the editor is doing to give you a little help it finding typos?&amp;nbsp; I wouldn't worry about whether the editor knows how to highlight your code or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test whether there are in fact any observations that need updating.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select count(*) as number_to_update 
from work.test
where id in (select ID from work.list_of_IDs)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Perhaps none of the values of ID in LIST_OF_IDS match the values of ID in TEST.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584371#M166439</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-27T21:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584372#M166440</link>
      <description>&lt;P&gt;Yeah I actually realized my list_of_IDs was incorrect, some leading zeros were truncated in excel and that was causing the issue. Thanks for the help!!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584372#M166440</guid>
      <dc:creator>gmuersch</dc:creator>
      <dc:date>2019-08-27T21:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584373#M166441</link>
      <description>&lt;P&gt;It should work. Make sure the IDs are exactly the same in both tables. Watch for leading spaces or zeros if the IDs are character, or fields that differ but look the same only because of formats.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584373#M166441</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-08-27T21:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584374#M166442</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276861"&gt;@gmuersch&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yeah I actually realized my list_of_IDs was incorrect, some leading zeros were truncated in excel and that was causing the issue. Thanks for the help!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Excel is where data goes to die.&amp;nbsp; Or at least get managled into unrecognizable junk.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 21:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584374#M166442</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-27T21:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584391#M166450</link>
      <description>&lt;P&gt;"IN" used that way is an operator and basically none of the operators like: + * - / OR AND NOT &amp;gt; &amp;lt; are highlighted. So that isn't to be worried about at all. Depending on SAS modules you'll find many key elements that are not highlighted and sometimes ones reported as "unknown keywords" just because the Editor hasn't been told to see them yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Small example data of your values may provide some insight. Only provide examples of the variables used.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 23:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584391#M166450</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-27T23:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL UPDATE not working with IN keyword</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584404#M166451</link>
      <description>&lt;P&gt;Do you have an Excel file or a CSV file?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276861"&gt;@gmuersch&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yeah I actually realized my list_of_IDs was incorrect, some leading zeros were truncated in excel and that was causing the issue. Thanks for the help!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 02:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-UPDATE-not-working-with-IN-keyword/m-p/584404#M166451</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-28T02:33:52Z</dc:date>
    </item>
  </channel>
</rss>

