<?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: UPDATE one variable using another variable in the same dataset. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80182#M17267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!!&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Mar 2013 21:18:24 GMT</pubDate>
    <dc:creator>jcis7</dc:creator>
    <dc:date>2013-03-18T21:18:24Z</dc:date>
    <item>
      <title>UPDATE one variable using another variable in the same dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80180#M17265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. This Question has 2 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've a dataset, Table A with a variable, 'dist' which may have incorrect values. and have added a new variable 'dist_orig' which has the updated values.&lt;/P&gt;&lt;P&gt;However, 'dist_orig' only has updated values for some but not all observations (i.e, some are missing).&amp;nbsp; Therefore I don't want to overwrite 'dist' with missing values in 'dist_orig';&lt;/P&gt;&lt;P&gt;I want to retain values of 'dist' for which I"m missing values in 'dist_orig'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ulitmate goal is to update the variable 'dist' with the values in dist_org.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to do it if I divide Table A into 2 datasets and use the UPDATE statement.&lt;/P&gt;&lt;P&gt;But, how do you update 'dist' with values in 'dist_orig' if they're in the same dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 19:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80180#M17265</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2013-03-18T19:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: UPDATE one variable using another variable in the same dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80181#M17266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if both variables are numeric:&lt;/P&gt;&lt;P&gt;dist=coalesce(dist_org,dist);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or they are Char:&lt;/P&gt;&lt;P&gt;dist=coalescec(dist_org,dist);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check docs for details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;deleted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 20:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80181#M17266</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-03-18T20:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: UPDATE one variable using another variable in the same dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80182#M17267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!!&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 21:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UPDATE-one-variable-using-another-variable-in-the-same-dataset/m-p/80182#M17267</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2013-03-18T21:18:24Z</dc:date>
    </item>
  </channel>
</rss>

