<?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 Merging two data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483955#M125564</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;a dataset with a number of same id and different observations for&amp;nbsp;another&amp;nbsp;dummy variable.&amp;nbsp; I hope to make it so that there's one row for each id and the count becomes a sum of all of the observations. Such as&lt;/P&gt;&lt;P&gt;1 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 1&lt;/P&gt;&lt;P&gt;3 0&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;4 1&lt;/P&gt;&lt;P&gt;2 1&lt;/P&gt;&lt;P&gt;3 1&lt;/P&gt;&lt;P&gt;4 0&lt;/P&gt;&lt;P&gt;5 0&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Becoming&lt;/P&gt;&lt;P&gt;1 3&lt;/P&gt;&lt;P&gt;2 2&lt;/P&gt;&lt;P&gt;3 1&lt;/P&gt;&lt;P&gt;4 1&lt;/P&gt;&lt;P&gt;5 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gratefully,&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Aug 2018 01:26:32 GMT</pubDate>
    <dc:creator>mroy01</dc:creator>
    <dc:date>2018-08-04T01:26:32Z</dc:date>
    <item>
      <title>Merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483955#M125564</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;a dataset with a number of same id and different observations for&amp;nbsp;another&amp;nbsp;dummy variable.&amp;nbsp; I hope to make it so that there's one row for each id and the count becomes a sum of all of the observations. Such as&lt;/P&gt;&lt;P&gt;1 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 1&lt;/P&gt;&lt;P&gt;3 0&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;4 1&lt;/P&gt;&lt;P&gt;2 1&lt;/P&gt;&lt;P&gt;3 1&lt;/P&gt;&lt;P&gt;4 0&lt;/P&gt;&lt;P&gt;5 0&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Becoming&lt;/P&gt;&lt;P&gt;1 3&lt;/P&gt;&lt;P&gt;2 2&lt;/P&gt;&lt;P&gt;3 1&lt;/P&gt;&lt;P&gt;4 1&lt;/P&gt;&lt;P&gt;5 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gratefully,&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 01:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483955#M125564</guid>
      <dc:creator>mroy01</dc:creator>
      <dc:date>2018-08-04T01:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483956#M125565</link>
      <description>&lt;P&gt;SAS knows how to do that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;class id;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;var dummy;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output out=want (keep=id total) sum=total;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 01:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483956#M125565</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-04T01:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483957#M125566</link>
      <description>&lt;P&gt;something like below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select id, sum(secondcolumn) as secondcolumn&lt;/P&gt;
&lt;P&gt;from yourtable&lt;/P&gt;
&lt;P&gt;group by&amp;nbsp;id&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 02:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/483957#M125566</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-08-04T02:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/484436#M125773</link>
      <description>&lt;P&gt;Thank you for this tip!&amp;nbsp; I forgot to mention that I'm hoping to keep other variables in the summary as well.&amp;nbsp; Any ideas to achieve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 16:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/484436#M125773</guid>
      <dc:creator>mroy01</dc:creator>
      <dc:date>2018-08-06T16:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/484513#M125796</link>
      <description>&lt;P&gt;You can keep other variables.&amp;nbsp; But you have to choose from among more than one value.&amp;nbsp; When you get a sum, that comes from many observations, but only one of the values of those other variables can be saved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at MINID and MAXID.&amp;nbsp; You can select whether you want the minimum or the maximum value of the "other" variables kept in the summary data set.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 19:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-two-data-sets/m-p/484513#M125796</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-06T19:50:45Z</dc:date>
    </item>
  </channel>
</rss>

