<?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 join a number of columns with same observation in each row with another dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715741#M221108</link>
    <description>&lt;P&gt;Or a SQL cartesian join:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   select a.*, b.*
      from a,&amp;nbsp;b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Feb 2021 09:55:56 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2021-02-01T09:55:56Z</dc:date>
    <item>
      <title>how to join a number of columns with same observation in each row with another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715726#M221100</link>
      <description>&lt;P&gt;I have a dataset with 2 columns and 10 rows like this:&lt;/P&gt;
&lt;P&gt;student marks&lt;BR /&gt;a&amp;nbsp; 10&lt;BR /&gt;b&amp;nbsp; 40&lt;BR /&gt;c&amp;nbsp; 39&lt;BR /&gt;d&amp;nbsp; 45&lt;BR /&gt;e&amp;nbsp; 78&lt;BR /&gt;f&amp;nbsp; 65&lt;BR /&gt;g&amp;nbsp; 38&lt;BR /&gt;h&amp;nbsp; 87&lt;BR /&gt;i&amp;nbsp; &amp;nbsp;98&lt;BR /&gt;j&amp;nbsp; 29&lt;/P&gt;
&lt;P&gt;I have another single row dataset with 5 columns-&lt;/P&gt;
&lt;P&gt;col1 col2 col3 col4 col5&lt;BR /&gt;m&amp;nbsp; &amp;nbsp; &amp;nbsp;k&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g&amp;nbsp; &amp;nbsp; &amp;nbsp; h&amp;nbsp; &amp;nbsp; &amp;nbsp;s&lt;/P&gt;
&lt;P&gt;Now I want to merge both the datasets in such a way that the single row of dataset 2 is joined alongside each row of dataset 1 .The final dataset may look like this:&lt;/P&gt;
&lt;P&gt;student marks col1 col2 col3 col4 col5&lt;BR /&gt;a 10 m k g h s&lt;BR /&gt;b 40 m k g h s&lt;BR /&gt;c 39 m k g h s&lt;BR /&gt;d 45 m k g h s&lt;BR /&gt;e 78 m k g h s&lt;BR /&gt;f 65 m k g h s&lt;BR /&gt;g 38 m k g h s&lt;BR /&gt;h 87 m k g h s&lt;BR /&gt;i 98 m k g h s&lt;BR /&gt;j 29 m k g h s&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I achieve this. I am working on base sas. Please help&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 08:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715726#M221100</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-02-01T08:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to join a number of columns with same observation in each row with another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715727#M221101</link>
      <description>&lt;P&gt;Here is one way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input student $ marks;
datalines;
a  10
b  40
c  39
d  45
e  78
f  65
g  38
h  87
i  98
j  29
;

data b;
input (col1-col5)(:$);
datalines;
m k g h s
;

data want;
   set a;
   if _N_ = 1 then set b;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Feb 2021 08:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715727#M221101</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-01T08:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to join a number of columns with same observation in each row with another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715741#M221108</link>
      <description>&lt;P&gt;Or a SQL cartesian join:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   select a.*, b.*
      from a,&amp;nbsp;b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Feb 2021 09:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-join-a-number-of-columns-with-same-observation-in-each/m-p/715741#M221108</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2021-02-01T09:55:56Z</dc:date>
    </item>
  </channel>
</rss>

