<?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 concatenate 3 datasets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520117#M3947</link>
    <description>&lt;P&gt;I do not agree. When I run this code, the employee data set contains 18 variables (4 drom Dept1, 8 from Dept2 and 6 from Dept3).&lt;/P&gt;</description>
    <pubDate>Mon, 10 Dec 2018 19:34:36 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-12-10T19:34:36Z</dc:date>
    <item>
      <title>How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520108#M3942</link>
      <description>&lt;P&gt;I have three datasets that I need to concatenate. One was created via a one-to-one merge of datasets, the other two are just regular datasets. I wrote the code but it only outputs data from the second set. I have attached the code I have so far, as well as the two datasets (I can attach the two individual datasets that were used to create the merged dataset called Dept1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520108#M3942</guid>
      <dc:creator>sasnewbie5</dc:creator>
      <dc:date>2018-12-10T19:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520112#M3943</link>
      <description>&lt;P&gt;Please post your code directly in your post using the little running man symbol.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520112#M3943</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-10T19:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520113#M3944</link>
      <description>&lt;P&gt;Ok so it seems that it does concatenate two of the three datasets. However, the one that I previously created does not concatenate with them. Can anyone provide any insight/solution as to why the first already-merged dataset won't concatenate?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520113#M3944</guid>
      <dc:creator>sasnewbie5</dc:creator>
      <dc:date>2018-12-10T19:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520114#M3945</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Dept1Names;
input name $ empid $;
datalines;
NELSON 254
MITCHELL 362
PEREZ 910
CARTER 935
;
data Dept1Salaries;
input salary  id $;
datalines;
103100 254
100200 362
73500 910
88400 935
;

data Dept1;
merge Dept1Names Dept1Salaries;
keep name salary;
run;

/***Problem #2***/	
data Dept2;
input name $ salary;
datalines;
ROBERTS 74000
TURNER 89200
PHILLIPS 87000
CAMPBELL 104600
PARKER 87800
EVANS 73100
EDWARDS 72300
COLLINS 100500
;


data Dept3;
input name $ salary;
datalines;
STEWART 102600
SANCHEZ 103300
MORRIS 87200
ROGERS 70700
REED 73000
COOK 88900
;

data Employee;
	set Dept1 Dept2 Dept3;
run;	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code under "Problem 1" created the first dataset via one to one merging. Then under "problem 2", I'm trying to concatenate the dataset from problem one with the other two newly created datasets.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520114#M3945</guid>
      <dc:creator>sasnewbie5</dc:creator>
      <dc:date>2018-12-10T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520117#M3947</link>
      <description>&lt;P&gt;I do not agree. When I run this code, the employee data set contains 18 variables (4 drom Dept1, 8 from Dept2 and 6 from Dept3).&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520117#M3947</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-10T19:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520119#M3949</link>
      <description>&lt;P&gt;Hmmm, I'm not sure why but when I run it it only shows 14. I did notice that the log says that 18 observations were created but it still only shows 14 in the output. I have absolutely no idea what's going on with this one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520119#M3949</guid>
      <dc:creator>sasnewbie5</dc:creator>
      <dc:date>2018-12-10T19:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520123#M3950</link>
      <description>&lt;P&gt;I just refreshed the library and now it shows 18. Usually I don't have to do this but for some reason I had to this time. Thanks for confirming the results Draycut!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520123#M3950</guid>
      <dc:creator>sasnewbie5</dc:creator>
      <dc:date>2018-12-10T19:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520125#M3951</link>
      <description>&lt;P&gt;If the log says there is 18 observations in the &lt;STRONG&gt;Employee&lt;/STRONG&gt; data set, there is 18&amp;nbsp;&lt;SPAN&gt;observations in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Employee&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;data set. Period &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When I run this exact code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/***Problem #1***/
data Dept1Names;
input name $ empid $;
datalines;
NELSON 254
MITCHELL 362
PEREZ 910
CARTER 935
;
data Dept1Salaries;
input salary  id $;
datalines;
103100 254
100200 362
73500 910
88400 935
;

data Dept1;
merge Dept1Names Dept1Salaries;
keep name salary;
run;

/***Problem #2***/	
data Dept2;
input name $ salary;
datalines;
ROBERTS 74000
TURNER 89200
PHILLIPS 87000
CAMPBELL 104600
PARKER 87800
EVANS 73100
EDWARDS 72300
COLLINS 100500
;

data Dept3;
input name $ salary;
datalines;
STEWART 102600
SANCHEZ 103300
MORRIS 87200
ROGERS 70700
REED 73000
COOK 88900
;

data Employee;
	set Dept1 Dept2 Dept3;
run;

proc print data=Employee;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I see this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture.PNG" style="width: 137px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25525iC97AAFB06E4C1D64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520125#M3951</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-10T19:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate 3 datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520126#M3952</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Glad you found your answer. Please mark the thread as accepted to help other users navigate the communities&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 19:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-concatenate-3-datasets/m-p/520126#M3952</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-10T19:43:15Z</dc:date>
    </item>
  </channel>
</rss>

