<?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: delete the duplicate and adding the two values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710499#M26792</link>
    <description>&lt;P&gt;What does ID mean? It seems you assigned it just the observation number and it can be neglected and dropped?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you drop ID, sort the data by a then select last.a - maybe you will get what you want.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2021 06:25:14 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2021-01-11T06:25:14Z</dc:date>
    <item>
      <title>delete the duplicate and adding the two values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710477#M26788</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a data&lt;/P&gt;&lt;P&gt;id&amp;nbsp; a&amp;nbsp; b&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; 1&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above data I have "a" has duplicate. So. I want take the second duplicate value "b" to the first.&lt;/P&gt;&lt;P&gt;Also the missing values should be deleted if it is in between the duplicates. If the missing values are not between, then I want to take only one and not the duplicate missing value.&lt;/P&gt;&lt;P&gt;want data:&lt;/P&gt;&lt;P&gt;id a&amp;nbsp; b&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 1&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;4&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 23:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710477#M26788</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2021-01-10T23:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: delete the duplicate and adding the two values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710499#M26792</link>
      <description>&lt;P&gt;What does ID mean? It seems you assigned it just the observation number and it can be neglected and dropped?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you drop ID, sort the data by a then select last.a - maybe you will get what you want.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 06:25:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710499#M26792</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-11T06:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: delete the duplicate and adding the two values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710526#M26794</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id  a  b ;
cards;
1   1  2
2   .    .
3   1   3
4   .     .
5   .     .
;

data temp;
 set have end=last;
 by id a b notsorted;
 if cmiss(a,b)=2 and not last then delete;
run;
data want;
 set temp;
 by a notsorted;
 if last.a;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 11:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/delete-the-duplicate-and-adding-the-two-values/m-p/710526#M26794</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-11T11:27:58Z</dc:date>
    </item>
  </channel>
</rss>

