<?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: Create a new dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786035#M81352</link>
    <description>&lt;P&gt;Thank you for the prompt reply. I don't want to match by SIZE. As long as the FIRM and YEAR of both the samples match, then I want to delete such observations from full_sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;</description>
    <pubDate>Tue, 14 Dec 2021 17:54:58 GMT</pubDate>
    <dc:creator>GokulK</dc:creator>
    <dc:date>2021-12-14T17:54:58Z</dc:date>
    <item>
      <title>Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786028#M81350</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have two datasets—Dataset &lt;EM&gt;Test_Sample&lt;/EM&gt; and &lt;EM&gt;Full_Sample&lt;/EM&gt; where the dataset &lt;EM&gt;Test_Sample&lt;/EM&gt; is a subset of &lt;EM&gt;Full_Sample&lt;/EM&gt;. I want to delete observations that I have in &lt;EM&gt;Test_Sample&lt;/EM&gt; from &lt;EM&gt;Full_Sample&lt;/EM&gt;. For instance, if my &lt;EM&gt;Test_Sample&lt;/EM&gt; and &lt;EM&gt;Full_Sample&lt;/EM&gt; look as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Test_Sample&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Firm&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Year&amp;nbsp; &amp;nbsp; &amp;nbsp;Size&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.1&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Full_sample&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Firm&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Year&amp;nbsp; &amp;nbsp; Size&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.1&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.2&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.9&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The desired output is&lt;/P&gt;&lt;P&gt;Firm&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Year&amp;nbsp; &amp;nbsp; &amp;nbsp; Size&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.2&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7.9&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please share the code with me so that I can get the desired output?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 17:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786028#M81350</guid>
      <dc:creator>GokulK</dc:creator>
      <dc:date>2021-12-14T17:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786034#M81351</link>
      <description>&lt;P&gt;Here's the basic idea:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data desired;
   merge test_sample (in=delete_these) full_sample;
   by firm year;
   if delete_these then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is some question about what should happen if the FIRM and YEAR match, but the SIZE is different.&amp;nbsp; This program gets rid of those observations.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 17:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786034#M81351</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-12-14T17:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786035#M81352</link>
      <description>&lt;P&gt;Thank you for the prompt reply. I don't want to match by SIZE. As long as the FIRM and YEAR of both the samples match, then I want to delete such observations from full_sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 17:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786035#M81352</guid>
      <dc:creator>GokulK</dc:creator>
      <dc:date>2021-12-14T17:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786039#M81353</link>
      <description>&lt;P&gt;If the values differ does it matter which one is kept?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 18:08:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786039#M81353</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-14T18:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786040#M81354</link>
      <description>&lt;P&gt;Hello Reeza,&lt;/P&gt;&lt;P&gt;Full_sample observations = Test_sample observations + non test firm-year observations. Since Full_sample has more observations, I want to delete firm-year observations from full_sample that are similar to Test_sample. So I will have three unique samples--Full_sample, Test_sample, and NonTest_sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 18:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786040#M81354</guid>
      <dc:creator>GokulK</dc:creator>
      <dc:date>2021-12-14T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786154#M81358</link>
      <description>&lt;PRE&gt;data test;
input Firm   $    Year     Size;
cards;
A            2011      8
A            2012      8.1
B            2011      7
;
 

data Full;
input Firm   $   Year    Size;
cards;
A            2011      8
A            2012      8.1
B            2011      7
B            2012      7.2
C            2011      7.9
C            2012      8.1
;

proc sql;
create table want as
select * from full
except
select * from test
;
quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-dataset/m-p/786154#M81358</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-15T12:28:15Z</dc:date>
    </item>
  </channel>
</rss>

