<?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: Setting a dataset of each row of another dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338050#M76856</link>
    <description>&lt;P&gt;It's called a cartesian join or cross join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table want as&lt;/P&gt;
&lt;P&gt;select *&lt;/P&gt;
&lt;P&gt;from a,b;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 22:23:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-03T22:23:55Z</dc:date>
    <item>
      <title>Setting a dataset of each row of another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338048#M76855</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;I have one dataset which has one variable, containing a person's name and another dataset with a list of training courses and I was wondering if there is a quick way to create a third dataset which would contain a record for each possible person and training combination. &amp;nbsp;The two datasets do not have a common variable. &amp;nbsp;Keep in mind that we may not know how many of each we have at any time, and the data can change constantly. &amp;nbsp;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset A:&lt;/P&gt;
&lt;P&gt;Name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Abby&lt;/P&gt;
&lt;P&gt;Bobby&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset B:&lt;/P&gt;
&lt;P&gt;Training&lt;/P&gt;
&lt;P&gt;Training #1&lt;/P&gt;
&lt;P&gt;Training #2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired Dataset:&lt;/P&gt;
&lt;P&gt;Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training&lt;/P&gt;
&lt;P&gt;Abby &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #1&lt;/P&gt;
&lt;P&gt;Abby &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #2&lt;/P&gt;
&lt;P&gt;Bobby &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #1&lt;/P&gt;
&lt;P&gt;Bobby &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #2&lt;/P&gt;
&lt;P&gt;Chris &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #1&lt;/P&gt;
&lt;P&gt;Chris &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training #2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Any thoughts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Phil&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338048#M76855</guid>
      <dc:creator>Phil0917</dc:creator>
      <dc:date>2017-03-03T22:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a dataset of each row of another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338050#M76856</link>
      <description>&lt;P&gt;It's called a cartesian join or cross join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table want as&lt;/P&gt;
&lt;P&gt;select *&lt;/P&gt;
&lt;P&gt;from a,b;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338050#M76856</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-03T22:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a dataset of each row of another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338055#M76858</link>
      <description>&lt;P&gt;Thanks! &amp;nbsp;That worked perfectly! &amp;nbsp;It did give me a "NOTE: The execution of this query involves performing one or &lt;BR /&gt; more Cartesian product joins that can not be optimized." message, but it did seem to create all of the desired records.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 22:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338055#M76858</guid>
      <dc:creator>Phil0917</dc:creator>
      <dc:date>2017-03-03T22:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a dataset of each row of another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338065#M76863</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input name $;
cards;
abby
bobby
chris
;
run;

data b;
length training $ 11;
input training &amp;amp;;
cards;
training #1
training #2
;
run;

data c;
set a;
do _n_=1 to nobs;
  set b nobs=nobs point=_n_;
  output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 23:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-a-dataset-of-each-row-of-another-dataset/m-p/338065#M76863</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-03T23:02:29Z</dc:date>
    </item>
  </channel>
</rss>

