<?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 Need help with appending two data sets in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605613#M17225</link>
    <description>&lt;P&gt;So this is my coding:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data apple.import;&lt;BR /&gt;input App $ Size $ Price $ Rating $ Genres $;&lt;BR /&gt;datalines;&lt;BR /&gt;PAC-MAN_Premium 100788224 3.99 4 Games&lt;BR /&gt;Evernote_-_stay_organized 158578688 0 4 Productivity&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data google.import;&lt;BR /&gt;input App $ Size $ Price $ Rating $ Genres $;&lt;BR /&gt;datalines;&lt;BR /&gt;Photo_Editor_&amp;amp;_Candy_Camera_&amp;amp;_Grid_&amp;amp;_ScrapBook 19M 0 4.1 Art &amp;amp; Design&lt;BR /&gt;Sketch_-_Draw_&amp;amp;_Paint 25M 0 4.5 Art &amp;amp; Design&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work;&lt;BR /&gt;merge apple.import google.import;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=work;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= apple.import;&lt;BR /&gt;by App;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= google.import;&lt;BR /&gt;by App;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but somehow my Apple and Google data sets aren't merging, showing only the result for Google.&lt;/P&gt;&lt;P&gt;Oh and&amp;nbsp; I used this youtube video to help me :&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=-xqcH5pKhz8" target="_blank"&gt;https://www.youtube.com/watch?v=-xqcH5pKhz8&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 04:18:45 GMT</pubDate>
    <dc:creator>hugoyamauchi</dc:creator>
    <dc:date>2019-11-20T04:18:45Z</dc:date>
    <item>
      <title>Need help with appending two data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605613#M17225</link>
      <description>&lt;P&gt;So this is my coding:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data apple.import;&lt;BR /&gt;input App $ Size $ Price $ Rating $ Genres $;&lt;BR /&gt;datalines;&lt;BR /&gt;PAC-MAN_Premium 100788224 3.99 4 Games&lt;BR /&gt;Evernote_-_stay_organized 158578688 0 4 Productivity&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data google.import;&lt;BR /&gt;input App $ Size $ Price $ Rating $ Genres $;&lt;BR /&gt;datalines;&lt;BR /&gt;Photo_Editor_&amp;amp;_Candy_Camera_&amp;amp;_Grid_&amp;amp;_ScrapBook 19M 0 4.1 Art &amp;amp; Design&lt;BR /&gt;Sketch_-_Draw_&amp;amp;_Paint 25M 0 4.5 Art &amp;amp; Design&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work;&lt;BR /&gt;merge apple.import google.import;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=work;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= apple.import;&lt;BR /&gt;by App;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= google.import;&lt;BR /&gt;by App;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but somehow my Apple and Google data sets aren't merging, showing only the result for Google.&lt;/P&gt;&lt;P&gt;Oh and&amp;nbsp; I used this youtube video to help me :&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=-xqcH5pKhz8" target="_blank"&gt;https://www.youtube.com/watch?v=-xqcH5pKhz8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 04:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605613#M17225</guid>
      <dc:creator>hugoyamauchi</dc:creator>
      <dc:date>2019-11-20T04:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with appending two data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605619#M17226</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291969"&gt;@hugoyamauchi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a similar situation ( having same variables and in same order), use PROC APPEND as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc append base = apple data = google;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have not used the LIBREF here.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 05:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605619#M17226</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-11-20T05:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with appending two data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605625#M17228</link>
      <description>&lt;P&gt;Lets start with your first data-step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data apple.import;
  input App $ Size $ Price $ Rating $ Genres $;
  datalines;
PAC-MAN_Premium 100788224 3.99 4 Games
Evernote_-_stay_organized 158578688 0 4 Productivity
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are you sure about having a library called "apple"? Same issue with the second data-step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the title you are talking about appending datasets, but you are merging them. If you want to append both datasets, either use proc append or use the set-statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combined;
  set apple_import google_import;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 06:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605625#M17228</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-11-20T06:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with appending two data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605659#M17237</link>
      <description>&lt;P&gt;Please post the&amp;nbsp;&lt;EM&gt;whole&lt;/EM&gt; log of these steps. Use the {i} button to post that log.&lt;/P&gt;
&lt;P&gt;We will then be able to take care of every single problem (as I suspect there are quite many), one by one.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 09:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605659#M17237</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-20T09:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with appending two data sets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605824#M17300</link>
      <description>&lt;P&gt;MERGE has a specific meaning in SAS and I suspect you are conceptually using the word merge in a different meaning.&lt;/P&gt;
&lt;P&gt;Here is an example of a MERGE of two data sets in SAS with no common variables so you can see the result:&lt;/P&gt;
&lt;PRE&gt;data work.one;
   input x y;
datalines;
1 2 
3 4
6 6
;

data work.two;
   input w z;
datalines;
33 44
55 66
;
/* no common variables*/
data work.merge1;
  merge  work.one work.two;
run;&lt;/PRE&gt;
&lt;P&gt;MERGE in SAS means to align rows side by side. If there are common values then the values from one data set will appear&lt;/P&gt;
&lt;PRE&gt;data work.three;
   input x z;
datalines;
99 88
88 99
;

/* common variable*/
data work.merge2;
   merge work.one work.three;

run;&lt;/PRE&gt;
&lt;P&gt;Notice that the values of X in the work.merge2 data set for the first two rows are the X values from work.three.&lt;/P&gt;
&lt;P&gt;Your merge meant that since you have the same variables in both sets that most likely you only see the "google" data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you want apparently is to STACK records from one set above the other. That is done in a data step with the SET statement. This shows what SET will do with data with no common variables and once common variable.&lt;/P&gt;
&lt;PRE&gt;data work.set1;
  set  work.one work.two;
run;

/* or with one common variable*/

data work.set2;
   set work.one work.three;

run;&lt;/PRE&gt;
&lt;P&gt;I suspect you're going to have some issues about lengths of common variables though.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 16:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-appending-two-data-sets/m-p/605824#M17300</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-20T16:09:46Z</dc:date>
    </item>
  </channel>
</rss>

