<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546055#M151153</link>
    <description>&lt;P&gt;Please use the proper methods for posting code and results. Right now one has to guess, given your spaghetti post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code is best posted with the "little running man" icon, textual data and logs with the {i} button. Help us to help you, it's not rocket science.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;data t1; input x y; cards; 1 2 2 3 ; run; data t2; input x y; cards; 2 5 3 6 4 9 ; run; I want output: -------------------- x y x y 1 2 2 5 1 2 3 6 1 2 4 9 2 3 2 5 2 3 3 6 2 3 4 9&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2019 08:52:28 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-03-26T08:52:28Z</dc:date>
    <item>
      <title>merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546045#M151150</link>
      <description>&lt;P&gt;data t1; input x y; cards; 1 2 2 3 ; run; data t2; input x y; cards; 2 5 3 6 4 9 ; run; I want output: -------------------- x y x y 1 2 2 5 1 2 3 6 1 2 4 9 2 3 2 5 2 3 3 6 2 3 4 9&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546045#M151150</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-03-26T08:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546054#M151152</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want us to spend time for you then you need to spend a bit more time for asking the question.&lt;/P&gt;
&lt;P&gt;To post code please use one of the following icons&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 53px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28207iF5BAD434ED414B75/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&amp;nbsp;so that things don't turn up as badly as what you're giving us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And to address your implicit question:&lt;/P&gt;
&lt;P&gt;You're after a Cartesian Product. That's done using a SQL JOIN. If this is homework and you've been asked to use a data step merge then it's important that you read in the documentation about joining/merging data sets and start to understand the difference between a SAS Data Step Merge and a SQL JOIN.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546054#M151152</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-03-26T08:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546055#M151153</link>
      <description>&lt;P&gt;Please use the proper methods for posting code and results. Right now one has to guess, given your spaghetti post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code is best posted with the "little running man" icon, textual data and logs with the {i} button. Help us to help you, it's not rocket science.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;data t1; input x y; cards; 1 2 2 3 ; run; data t2; input x y; cards; 2 5 3 6 4 9 ; run; I want output: -------------------- x y x y 1 2 2 5 1 2 3 6 1 2 4 9 2 3 2 5 2 3 3 6 2 3 4 9&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546055#M151153</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-26T08:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: merging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546057#M151154</link>
      <description>&lt;P&gt;Two variables can't have the same name in SAS. Other than that, this code gives you what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t1; 
input x y; 
cards; 
1 2 
2 3 
; 
run; 

data t2; 
input x y; 
cards; 
2 5 
3 6 
4 9 
; 
run;

data want;

   set t1;

   do i=1 to n;
      set t2(rename=(x=x2 y=y2)) point=i nobs=n;
      output;
   end;

run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture.PNG" style="width: 262px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28208i368306CBFBD24A3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merging/m-p/546057#M151154</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-26T08:57:18Z</dc:date>
    </item>
  </channel>
</rss>

