<?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: SAS &amp;quot;Set&amp;quot; statement when combining two data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520634#M141216</link>
    <description>&lt;PRE&gt;DATA work.first;
  Input common $ X;
  cards;
  A 10
  A 13
  A 14
  B 9
  ;
  run;
  
DATA work.second;
  input common $ Y;
  cards;
  A 1
  A 3
  B 4
  B 2
  ;
  run;
  
data work.combine;
  SET work.first;
  set work.second;
  run;
  &lt;/PRE&gt;&lt;P&gt;This was what I used to run the command earlier. Sorry after adding "Proc Print data=work.combine;"&lt;/P&gt;&lt;P&gt;I found it was because of the screen blocking the other half of the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 00:14:07 GMT</pubDate>
    <dc:creator>jc3992</dc:creator>
    <dc:date>2018-12-12T00:14:07Z</dc:date>
    <item>
      <title>SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520547#M141163</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing some SAS certificate questions, and I have run the code below,&lt;/P&gt;&lt;P&gt;and got the different answer as it provided with on the Internet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA work.first;
  Input common $ X;
  cards;
  A 10
  A 13
  A 14
  B 9
  ;
  run;
  
DATA work.second;
  input common $ Y;
  cards;
  A 1
  A 3
  B 4
  B 2
  ;
  run;
  
data work.combine;
  SET work.first;
  set work.second;
  run;
  
  &lt;/PRE&gt;&lt;P&gt;The question is: what data values are stored in data set work.combine?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;common X Y&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13 3&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14 4&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my result when I tested it in SAS is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;common X&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would anyone tell me which is the correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520547#M141163</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-11T20:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520554#M141168</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188695"&gt;@jc3992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am doing some SAS certificate questions, and I have run the code below,&lt;/P&gt;
&lt;P&gt;and got the different answer as it provided with on the Internet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DATA work.first;
  Input common $ X;
  cards;
  A 10
  A 13
  A 14
  B 9
  ;
  run;
  
DATA work.second;
  input common $ Y;
  cards;
  A 1
  A 3
  B 4
  B 2
  ;
  run;
  
data work.combine;
  SET work.first;
  set work.second;
  run;
  
  &lt;/PRE&gt;
&lt;P&gt;The question is: what data values are stored in data set work.combine?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;common X Y&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10 1&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13 3&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14 4&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But my result when I tested it in SAS is:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;common X&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would anyone tell me which is the correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post your log. I ran the exact code and get a different output. I suspect you've named them &lt;STRONG&gt;both X instead of X and Y?&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520554#M141168</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T20:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520559#M141171</link>
      <description>&lt;P&gt;The answer is correct.&amp;nbsp; Somehow, the program you tested is different than the one in the practice exam.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Incidentally, is this a SAS provided practice exam?&amp;nbsp; It would be highly unusual for SAS to add a RUN statement after a CARDS statement.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520559#M141171</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-11T21:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520601#M141198</link>
      <description>&lt;P&gt;The data sets were from my own creation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS did not give me the code to produce the data sets.&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 22:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520601#M141198</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-11T22:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520606#M141202</link>
      <description>&lt;PRE&gt;1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         DATA work.first;
 74           Input common $ X;
 75           cards;
 
 NOTE: The data set WORK.FIRST has 4 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 80           ;
 81           run;
 82         
 83         DATA work.second;
 84           input common $ Y;
 85           cards;
 
 NOTE: The data set WORK.SECOND has 4 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 90           ;
 91           run;
 92         
 93         data work.combine;
 94           SET work.first;
 95           set work.second;
 96           run;
 
 NOTE: There were 4 observations read from the data set WORK.FIRST.
 NOTE: There were 4 observations read from the data set WORK.SECOND.
 NOTE: The data set WORK.COMBINE has 4 observations and 3 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 97         
 98         
 99         
 100        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 113        &lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 22:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520606#M141202</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-11T22:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520607#M141203</link>
      <description>&lt;P&gt;The log says 4 obs and 3 variables which doesn't match what you posted, since it had only one variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still think the answer from my initial post is what happened.&amp;nbsp;&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/188695"&gt;@jc3992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         DATA work.first;
 74           Input common $ X;
 75           cards;
 
 NOTE: The data set WORK.FIRST has 4 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 80           ;
 81           run;
 82         
 83         DATA work.second;
 84           input common $ Y;
 85           cards;
 
 NOTE: The data set WORK.SECOND has 4 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 90           ;
 91           run;
 92         
 93         data work.combine;
 94           SET work.first;
 95           set work.second;
 96           run;
 
 NOTE: There were 4 observations read from the data set WORK.FIRST.
 NOTE: There were 4 observations read from the data set WORK.SECOND.
 NOTE: The data set WORK.COMBINE has 4 observations and 3 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 97         
 98         
 99         
 100        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 113        &lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 22:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520607#M141203</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T22:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520631#M141213</link>
      <description>&lt;P&gt;This code duplicates your stated output:&lt;/P&gt;
&lt;PRE&gt;DATA work.first;
  Input common $ X;
  cards;
  A 10
  A 13
  A 14
  B 9
  ;
  run;
  
DATA work.second;
  input common $ x;
  cards;
  A 1
  A 3
  B 4
  B 2
  ;
  run;
  
data work.combine;
  SET work.second;
  set work.first;
  run;
&lt;/PRE&gt;
&lt;P&gt;Note that the work.second has the same variable name X instead of Y &lt;STRONG&gt;and&lt;/STRONG&gt; the order of the two set statements is different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 23:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520631#M141213</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-11T23:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS "Set" statement when combining two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520634#M141216</link>
      <description>&lt;PRE&gt;DATA work.first;
  Input common $ X;
  cards;
  A 10
  A 13
  A 14
  B 9
  ;
  run;
  
DATA work.second;
  input common $ Y;
  cards;
  A 1
  A 3
  B 4
  B 2
  ;
  run;
  
data work.combine;
  SET work.first;
  set work.second;
  run;
  &lt;/PRE&gt;&lt;P&gt;This was what I used to run the command earlier. Sorry after adding "Proc Print data=work.combine;"&lt;/P&gt;&lt;P&gt;I found it was because of the screen blocking the other half of the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 00:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-quot-Set-quot-statement-when-combining-two-data-sets/m-p/520634#M141216</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-12-12T00:14:07Z</dc:date>
    </item>
  </channel>
</rss>

