<?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: 2 data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61784#M13435</link>
    <description>No it adds the new ones, as well as replacing existing.  I have used it to bring in daily transactions extensively.</description>
    <pubDate>Wed, 05 Aug 2009 15:06:47 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-08-05T15:06:47Z</dc:date>
    <item>
      <title>2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61781#M13432</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I have 2 datasets with the same variables. One data set has about a million records with the other containing about 2000. The main variable is accountnumber.&lt;BR /&gt;
&lt;BR /&gt;
So, herein lies my problem : The big dataset contains some of the account numbers from the smaller dataset, but the accompanying data with them is wrong. &lt;BR /&gt;
&lt;BR /&gt;
I need to have SAS check the large dataset for any of the account numbers found in the smaller data set and then remove them. After they are removed, I need to combine the datasets. Any suggestions?</description>
      <pubDate>Wed, 05 Aug 2009 14:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61781#M13432</guid>
      <dc:creator>Aar684</dc:creator>
      <dc:date>2009-08-05T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61782#M13433</link>
      <description>You should be able to UPDATE the large one with the small by account number.</description>
      <pubDate>Wed, 05 Aug 2009 15:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61782#M13433</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-08-05T15:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61783#M13434</link>
      <description>Won't that just replace the account numbers that are already there? Some of them aren't in the big set and need to be added. I thought UPDATE only updated the already present account numbers?</description>
      <pubDate>Wed, 05 Aug 2009 15:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61783#M13434</guid>
      <dc:creator>Aar684</dc:creator>
      <dc:date>2009-08-05T15:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61784#M13435</link>
      <description>No it adds the new ones, as well as replacing existing.  I have used it to bring in daily transactions extensively.</description>
      <pubDate>Wed, 05 Aug 2009 15:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61784#M13435</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-08-05T15:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61785#M13436</link>
      <description>UPDATE will do.&lt;BR /&gt;
&lt;BR /&gt;
If you have both tables sorted by account number, then you could also perform a DATA MERGE between the two tables, being the smaller one on the right side of the MERGE statement (to overwrite values of the left side table).&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;.</description>
      <pubDate>Wed, 05 Aug 2009 15:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61785#M13436</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-08-05T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61786#M13437</link>
      <description>consider MODIFY&lt;BR /&gt;
it allows update-in-place</description>
      <pubDate>Wed, 05 Aug 2009 16:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61786#M13437</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-08-05T16:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61787#M13438</link>
      <description>Thank you everyone for the help. &lt;BR /&gt;
&lt;BR /&gt;
I have a change in plans. So I have the dataset with 2 million records give or take. I then have a smaller dataset of about 2000 records. Both have the same variables and names. Once again the main variable I am using is accountnumber. Of the 2000 records in the smaller dataset, there are about 1500 of those same account numbers in the larger dataset. Only the account numbers would be the same, with the rest of the data on that line being different. I need to tell SAS to delete the entries in larger file that have matching account numbers in the smaller file. So, 1500 or so records would be deleted from the larger file that have matching account numbers in the smaller file. Is this possible?</description>
      <pubDate>Wed, 05 Aug 2009 17:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61787#M13438</guid>
      <dc:creator>Aar684</dc:creator>
      <dc:date>2009-08-05T17:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61788#M13439</link>
      <description>proc sql;&lt;BR /&gt;
delete from data1 where acct_num in (select acct_num from data2);</description>
      <pubDate>Wed, 05 Aug 2009 17:56:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61788#M13439</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-08-05T17:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61789#M13440</link>
      <description>Can't thank everyone enough.</description>
      <pubDate>Wed, 05 Aug 2009 18:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61789#M13440</guid>
      <dc:creator>Aar684</dc:creator>
      <dc:date>2009-08-05T18:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61790#M13441</link>
      <description>I sure hope that someone's backing up your data (oh, yes, with recoverability in mind)....with multiple versions.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 05 Aug 2009 18:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61790#M13441</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-08-05T18:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61791#M13442</link>
      <description>Yes it possible, with at least more than 4 different techniques.&lt;BR /&gt;
&lt;BR /&gt;
I will point just one.&lt;BR /&gt;
&lt;BR /&gt;
SORT both datasets by acountnumber, then match merge between the two (DATA MERGE) with subsetting IF for non matching observation.&lt;BR /&gt;
&lt;BR /&gt;
Something like this.&lt;BR /&gt;
&lt;BR /&gt;
data OUT;&lt;BR /&gt;
merge BIG (in=BIG) SMALL (in=SMALL);&lt;BR /&gt;
by ACCOUNTNUMBER; * match by ACCOUNTNUMBER;&lt;BR /&gt;
if not (BIG and SMALL); * if non matching key, then output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
More info on combining datasets:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001303248.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001303248.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a002645476.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a002645476.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;.</description>
      <pubDate>Thu, 06 Aug 2009 08:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-data-sets/m-p/61791#M13442</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-08-06T08:03:43Z</dc:date>
    </item>
  </channel>
</rss>

