<?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: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818641#M323141</link>
    <description>Thanks Kurt! This worked</description>
    <pubDate>Thu, 16 Jun 2022 17:26:26 GMT</pubDate>
    <dc:creator>RobertWF1</dc:creator>
    <dc:date>2022-06-16T17:26:26Z</dc:date>
    <item>
      <title>How to many-to-one join two tables without joined table containing duplicate values from 2nd table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818620#M323130</link>
      <description>&lt;P&gt;For example, in the following code notice how the table data_join contains multiple copies of the z values for A001 and B002.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to just retain the first row of values from the matched data2 table? I'm outputting joined tables to Excel and so it's easier on the eyes if there aren't so many duplicate rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data1;
input id :$4. x y;
cards;
A001 10 20
A001 30 40
A001 50 60
B002 1 2
B002 3 4
B002 5 6
;
run;

data data2;
input id :$4. z;
cards;
A001 1000
B002 2000
;
run;

proc sql;
create table data_join as
select *
from data1 a
inner join
data2 b
on a.id=b.id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818620#M323130</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-06-16T16:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818632#M323138</link>
      <description>&lt;P&gt;Use PROC REPORT for the export:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods xlsx file="/somewhere/file.xlsx";

proc report data=join;
column id x y z;
define id / group;
define x / display;
define y / display;
define z / group;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, posted from my tablet.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818632#M323138</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-16T16:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818633#M323139</link>
      <description>X/Y seem arbitrary then. Usually there's some business rule that should apply. &lt;BR /&gt;If they're not required can you just drop them?&lt;BR /&gt;Or would an aggregation of X/Y make sense, sum, mean, min?&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Jun 2022 16:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818633#M323139</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-16T16:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818641#M323141</link>
      <description>Thanks Kurt! This worked</description>
      <pubDate>Thu, 16 Jun 2022 17:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818641#M323141</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-06-16T17:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818647#M323142</link>
      <description>I made up data for my question, but the X and Y columns I need to keep (they represent proc freq row count &amp;amp; percent data) and the Z column represents chi-squared statistics I'm attaching to the table.</description>
      <pubDate>Thu, 16 Jun 2022 17:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818647#M323142</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-06-16T17:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818650#M323143</link>
      <description>&lt;P&gt;In that case I like this macro.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 17:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/818650#M323143</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-16T17:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to many-to-one join two tables without joined table containing duplicate values from 2nd tab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/819132#M323352</link>
      <description>Thank you Reeza!</description>
      <pubDate>Mon, 20 Jun 2022 13:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-many-to-one-join-two-tables-without-joined-table/m-p/819132#M323352</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-06-20T13:30:31Z</dc:date>
    </item>
  </channel>
</rss>

