<?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 Update: Updating SAS master table with another table creates missing values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198376#M49581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to update a master table with 15,401 observations of rural-urban continuum codes where there are 651 observations are labelled as missing because they are redacted. Using proc update, I am trying to update those redacted values using another table with just those 651 redacted values that have been un-redacted via each observations sequence number. My code does update the table, but it makes the 14750 observations that were not redacted into missing values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;UPDATE major as m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SET RUCC_2013 = (select RUCC_2013 from minor where sequence_number = m.SEQNO);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your solutions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Donald S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jul 2015 15:16:46 GMT</pubDate>
    <dc:creator>daszlosek</dc:creator>
    <dc:date>2015-07-08T15:16:46Z</dc:date>
    <item>
      <title>Proc Update: Updating SAS master table with another table creates missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198376#M49581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to update a master table with 15,401 observations of rural-urban continuum codes where there are 651 observations are labelled as missing because they are redacted. Using proc update, I am trying to update those redacted values using another table with just those 651 redacted values that have been un-redacted via each observations sequence number. My code does update the table, but it makes the 14750 observations that were not redacted into missing values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;UPDATE major as m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SET RUCC_2013 = (select RUCC_2013 from minor where sequence_number = m.SEQNO);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your solutions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Donald S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 15:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198376#M49581</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-08T15:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Update: Updating SAS master table with another table creates missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198377#M49582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have not put any where clause on the update that is why it updates all records:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;UPDATE major as m&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; SET RUCC_2013 = (select RUCC_2013 from minor where sequence_number = m.SEQNO)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where &amp;lt;conditon&amp;gt;;&amp;nbsp;&amp;nbsp; /* The condition here being which rows you want to update */&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 15:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198377#M49582</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-08T15:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Update: Updating SAS master table with another table creates missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198378#M49583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello RW9, that worked great. Here is what I did encase someone else gets stuck:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I re-wrote the code with the new where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;PROC SQL;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;UPDATE TEMP4&amp;nbsp; as t&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; SET RUCC_2013 = (select RUCC_2013 from minnesota where sequence_number = t.SEQNO)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; where RUCC_2013 = '.'; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I received the error "&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ERROR: Expression using equals (=) has components that are of different data types."&lt;/STRONG&gt; though both the sequence number variables and the RUCC_2013 variable in both datasets were labelled numerical. I changed the missing values to a numerical value instead of being left blank:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp4;&lt;/P&gt;&lt;P&gt;set temp3;&lt;/P&gt;&lt;P&gt;if RUCC_2013 = '.' then RUCC_2013 = 11;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Re-ran the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;UPDATE TEMP4&amp;nbsp; as t&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SET RUCC_2013 = (select RUCC_2013 from minnesota where sequence_number = t.SEQNO)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where RUCC_2013 = 11; &lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;And it worked perfectly.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P&gt;Though this worked, if you think there is a better way to do it, I would very much enjoy learning that as well!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 16:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198378#M49583</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-08T16:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Update: Updating SAS master table with another table creates missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198379#M49584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the reason you have got that is due to the fact you are comparing apples and oranges:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where RUCC_2013 = '.';&lt;/P&gt;&lt;P&gt;In this section you are comparing RUCC_2013 which is obviously a numeric field (from your later code) with the text string '.'&amp;nbsp; Your later code you fixed this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; where RUCC_2013 = 11;&lt;/P&gt;&lt;P&gt;So comparing the number 11 with the numeric RUCC_2013.&lt;/P&gt;&lt;P&gt;If you change your first code to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where RUCC_2013 = .;&lt;/P&gt;&lt;P&gt;or even:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where RUCC_2013 is null;&lt;/P&gt;&lt;P&gt;Then you will get the correct response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2015 16:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Update-Updating-SAS-master-table-with-another-table-creates/m-p/198379#M49584</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-08T16:57:08Z</dc:date>
    </item>
  </channel>
</rss>

