<?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 Help Merging Datasets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921160#M41312</link>
    <description>&lt;P&gt;I haven't used SAS in a while so this is probably a simple request, but I am having issues creating the dataset I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input id group $;
cards;
1 a
1 b
1 c
;
run;

data have2;
input id samplevalue;
cards;
1 0.25
1 0.50
1 0.75
;
run;

data want;
input id samplevalue group $;
cards;
1 0.25 a
1 0.50 a
1 0.75 a
1 0.25 b
1 0.50 b
1 0.75 b
1 0.25 c
1 0.50 c
1 0.75 c
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 18:33:29 GMT</pubDate>
    <dc:creator>JJ_83</dc:creator>
    <dc:date>2024-03-20T18:33:29Z</dc:date>
    <item>
      <title>Help Merging Datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921160#M41312</link>
      <description>&lt;P&gt;I haven't used SAS in a while so this is probably a simple request, but I am having issues creating the dataset I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input id group $;
cards;
1 a
1 b
1 c
;
run;

data have2;
input id samplevalue;
cards;
1 0.25
1 0.50
1 0.75
;
run;

data want;
input id samplevalue group $;
cards;
1 0.25 a
1 0.50 a
1 0.75 a
1 0.25 b
1 0.50 b
1 0.75 b
1 0.25 c
1 0.50 c
1 0.75 c
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 18:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921160#M41312</guid>
      <dc:creator>JJ_83</dc:creator>
      <dc:date>2024-03-20T18:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help Merging Datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921162#M41313</link>
      <description>&lt;P&gt;Not the only way. Proc SQL will allow joins on multiple values of matching variables where a data step merge typically doesn't yield the result desired when there are multiples of BY variables in both data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table want as
   select a.*,b.samplevalue
   from have1 as a
        full join
        have2 as b
        on a.id=b.id
   order by a.id, a.group, b.samplevalue
   ;
quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2024 18:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921162#M41313</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-20T18:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help Merging Datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921163#M41314</link>
      <description>&lt;P&gt;Hello! You can do so with a simple proc sql.&lt;/P&gt;&lt;P&gt;Select the variables you want from each dataset and merge the datasets by a variable that both datasets have (in this case that's the id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
    create table want as
    select a.id, b.samplevalue, a.group
    from have1 as a, have2 as b
    where a.id = b.id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 18:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921163#M41314</guid>
      <dc:creator>veronicasalmaso</dc:creator>
      <dc:date>2024-03-20T18:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help Merging Datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921176#M41317</link>
      <description>&lt;P&gt;Thank you so much, this is exactly what I needed and it works perfectly!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 19:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Merging-Datasets/m-p/921176#M41317</guid>
      <dc:creator>JJ_83</dc:creator>
      <dc:date>2024-03-20T19:54:06Z</dc:date>
    </item>
  </channel>
</rss>

