<?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: merging two data sets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/merging-two-data-sets/m-p/10261#M949</link>
    <description>I think that a SQL join would more appropriate/easier to do.&lt;BR /&gt;
You can calculate sales per row, and then summarize per transaction no in one step: (pseudo-code):&lt;BR /&gt;
&lt;BR /&gt;
create table total_sales as&lt;BR /&gt;
select id, trans_no, quantity * price as total_sale&lt;BR /&gt;
from sales left join parts&lt;BR /&gt;
on sales.part_no eq parts.part_no&lt;BR /&gt;
group by id, trans_no&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
    <pubDate>Mon, 02 Nov 2009 13:19:58 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-11-02T13:19:58Z</dc:date>
    <item>
      <title>merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-two-data-sets/m-p/10260#M948</link>
      <description>Hi,  I'm currently working with two data sets similar to:&lt;BR /&gt;
&lt;BR /&gt;
#1:&lt;BR /&gt;
data parts;&lt;BR /&gt;
&lt;BR /&gt;
part_no           price &lt;BR /&gt;
123                 15&lt;BR /&gt;
234                 25&lt;BR /&gt;
237                 20&lt;BR /&gt;
355                 28&lt;BR /&gt;
789                 55&lt;BR /&gt;
&lt;BR /&gt;
#2:&lt;BR /&gt;
data sales;&lt;BR /&gt;
&lt;BR /&gt;
ID        Trans_NO   Part_NO Quantity&lt;BR /&gt;
03        1                 234         5&lt;BR /&gt;
03        1                 123         9&lt;BR /&gt;
03        2                 237         4&lt;BR /&gt;
01        1                 355         5&lt;BR /&gt;
01        1                 234         3&lt;BR /&gt;
01        1                 123         9&lt;BR /&gt;
01        2                 355         5&lt;BR /&gt;
02        1                 237         11&lt;BR /&gt;
&lt;BR /&gt;
I want to make a new data set that only shows ID (sorted by ID), the transaction&lt;BR /&gt;
number, and the total sale for each transaction.&lt;BR /&gt;
&lt;BR /&gt;
I think I need to first merge the two data sets by Part_no so that I can&lt;BR /&gt;
compute to total sale, but I'm having trouble with what to do after this to get the proper dataset.&lt;BR /&gt;
Any help would be much appreciated!&lt;BR /&gt;
Helena</description>
      <pubDate>Sun, 01 Nov 2009 23:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-two-data-sets/m-p/10260#M948</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-01T23:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: merging two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-two-data-sets/m-p/10261#M949</link>
      <description>I think that a SQL join would more appropriate/easier to do.&lt;BR /&gt;
You can calculate sales per row, and then summarize per transaction no in one step: (pseudo-code):&lt;BR /&gt;
&lt;BR /&gt;
create table total_sales as&lt;BR /&gt;
select id, trans_no, quantity * price as total_sale&lt;BR /&gt;
from sales left join parts&lt;BR /&gt;
on sales.part_no eq parts.part_no&lt;BR /&gt;
group by id, trans_no&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Mon, 02 Nov 2009 13:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-two-data-sets/m-p/10261#M949</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-11-02T13:19:58Z</dc:date>
    </item>
  </channel>
</rss>

