<?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: merge 2 datasets with the second dataset through id in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723099#M224340</link>
    <description>&lt;P&gt;With a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input ID;
datalines;
1
2
3
4
;

data have2;
input TEXT $;
datalines;
Height
Weight
;

data want;
   set have1;
   do i=1 to n;
      set have2 point=i nobs=n;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ID  TEXT 
1   Height 
1   Weight 
2   Height 
2   Weight 
3   Height 
3   Weight 
4   Height 
4   Weight 
&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Mar 2021 09:35:17 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-03-03T09:35:17Z</dc:date>
    <item>
      <title>merge 2 datasets with the second dataset through id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723094#M224335</link>
      <description>&lt;P&gt;I have 2 datasets one has ID values and i want to merge it with text to get the values from text, i need something like below - want dataset. any help on it&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 48pt;" border="0" width="64" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 48pt;" border="0" width="64" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;TEXT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;Height&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;Weight&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want something like this&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;TXT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1&lt;/TD&gt;
&lt;TD&gt;Height&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1&lt;/TD&gt;
&lt;TD&gt;Weight&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2&lt;/TD&gt;
&lt;TD&gt;Height&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;2&lt;/TD&gt;
&lt;TD&gt;Weight&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;3&lt;/TD&gt;
&lt;TD&gt;Height&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;3&lt;/TD&gt;
&lt;TD&gt;Weight&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;4&lt;/TD&gt;
&lt;TD&gt;Height&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;4&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Weight&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 08:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723094#M224335</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2021-03-03T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: merge 2 datasets with the second dataset through id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723095#M224336</link>
      <description>&lt;P&gt;With Proc SQL you can create cartesian product just (You haven't defined dataset names , so I'm using column names)&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp; ID, TEXT;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 09:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723095#M224336</guid>
      <dc:creator>Aku</dc:creator>
      <dc:date>2021-03-03T09:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: merge 2 datasets with the second dataset through id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723099#M224340</link>
      <description>&lt;P&gt;With a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input ID;
datalines;
1
2
3
4
;

data have2;
input TEXT $;
datalines;
Height
Weight
;

data want;
   set have1;
   do i=1 to n;
      set have2 point=i nobs=n;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ID  TEXT 
1   Height 
1   Weight 
2   Height 
2   Weight 
3   Height 
3   Weight 
4   Height 
4   Weight 
&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 09:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-2-datasets-with-the-second-dataset-through-id/m-p/723099#M224340</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-03-03T09:35:17Z</dc:date>
    </item>
  </channel>
</rss>

