<?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: Correcting a merge dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674335#M203050</link>
    <description>&lt;UL&gt;
&lt;LI&gt;how many are in the second dataset &lt;STRONG&gt;before&lt;/STRONG&gt; and &lt;STRONG&gt;after&lt;/STRONG&gt; deduplicating (read the log)?&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Tue, 04 Aug 2020 12:39:49 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-08-04T12:39:49Z</dc:date>
    <item>
      <title>Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674256#M203025</link>
      <description>&lt;P&gt;Hi all. I am trying to duplicate SAS logic and get the same results that some else did previously merging two datasets. The first dataset (HPHC_EOL_FY20), has 85k lines and the second (EOL_COHORT), has 135 lines. In the original results that I am trying to duplicate the final result has 55k lines, when I run the below code I get 130k. I am no sure what I am doing wrong. Any advise would be appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
create table HPHC_FY20_EOL_combined_v2 as
	select med.*,eol.*
		from Dataset1 as med
				left join
			 Dataset2 as eol
			 	on med.member_id=eol.INSUREDSIDNUMBER
		;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 03:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674256#M203025</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T03:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674258#M203026</link>
      <description>&lt;P&gt;Without looking at the data, it is difficult to predict. However i assume the previous merge was done if both datasets had &lt;CODE class=" language-sas"&gt; med.member_id=eol.INSUREDSIDNUMBER&lt;/CODE&gt;, considering this i would try inner join instead if left join. please try and let me know if it works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
create table HPHC_FY20_EOL_combined_v2 as
	select med.*,eol.*
		from Dataset1 as med
				inner join
			 Dataset2 as eol
			 	on med.member_id=eol.INSUREDSIDNUMBER
		;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 03:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674258#M203026</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-08-04T03:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674271#M203027</link>
      <description>Thanks for the response Jag. I tried the inner join and got the same results. I think I have to delete dupes, but not sure how to do that.</description>
      <pubDate>Tue, 04 Aug 2020 05:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674271#M203027</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T05:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674274#M203028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for the response Jag. I tried the inner join and got the same results. I think I have to delete dupes, but not sure how to do that.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
  data=dataset2
  out=dedup
  nodupkey
;
by INSUREDSIDNUMBER;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 06:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674274#M203028</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T06:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674299#M203029</link>
      <description>Thanks Kurt for the response, but that did not work</description>
      <pubDate>Tue, 04 Aug 2020 10:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674299#M203029</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T10:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674305#M203030</link>
      <description>&lt;P&gt;Please describe in detail what happened. "Did not work" is not helpful at all, and worthy of the proverbial blonde secretary.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;how many observations are in the first dataset?&lt;/LI&gt;
&lt;LI&gt;how many are in the second dataset before and after deduplicating (read the log)?&lt;/LI&gt;
&lt;LI&gt;how many are in the result?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Mind that a left join will ALWAYS have at least the number of observations of the "left" dataset. To build the intersection set, you have to use an inner join.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 11:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674305#M203030</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T11:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674334#M203049</link>
      <description>Hi Kurt&lt;BR /&gt;&lt;BR /&gt;This is what I included in my original post:&lt;BR /&gt;&lt;BR /&gt;Hi all. I am trying to duplicate SAS logic and get the same results that some else did previously merging two datasets. The first dataset (HPHC_EOL_FY20), has 85k lines and the second (EOL_COHORT), has 135 lines. In the original results that I am trying to duplicate the final result has 55k lines, when I run the below code I get 130k. I am no sure what I am doing wrong. Any advise would be appreciated.</description>
      <pubDate>Tue, 04 Aug 2020 12:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674334#M203049</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T12:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674335#M203050</link>
      <description>&lt;UL&gt;
&lt;LI&gt;how many are in the second dataset &lt;STRONG&gt;before&lt;/STRONG&gt; and &lt;STRONG&gt;after&lt;/STRONG&gt; deduplicating (read the log)?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 04 Aug 2020 12:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674335#M203050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T12:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674346#M203055</link>
      <description>Hi Kurt&lt;BR /&gt;&lt;BR /&gt;This the log:&lt;BR /&gt;NOTE: There were 136 observations read from the data set WORK.dataset2.&lt;BR /&gt;NOTE: 33 observations with duplicate key values were deleted.&lt;BR /&gt;NOTE: The data set WORK.DEDUP has 103 observations and 17 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):</description>
      <pubDate>Tue, 04 Aug 2020 13:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674346#M203055</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T13:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674352#M203057</link>
      <description>&lt;P&gt;And how many observations resulted from the join of the large table with your deduped dataset?&lt;/P&gt;
&lt;P&gt;Do you need the deduped dataset to create a subset of the large table, or should all observations from the large table be kept?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674352#M203057</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T13:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674359#M203063</link>
      <description>There were still 130k lines..What I believe needs to happen is to delete all the dupes from the 130k</description>
      <pubDate>Tue, 04 Aug 2020 14:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674359#M203063</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T14:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674383#M203076</link>
      <description>&lt;P&gt;Did you change from a left join to an inner join? Please post the complete log of your current join step.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674383#M203076</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T15:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674404#M203084</link>
      <description>138 PROC SQL;&lt;BR /&gt;139 create table HPHC_FY20_EOL_combined_v2 as&lt;BR /&gt;140 select med.*,eol.*&lt;BR /&gt;141 from HPHC_EOL_FY20 as med&lt;BR /&gt;142 inner join&lt;BR /&gt;143 EOL_Cohort as eol&lt;BR /&gt;144 on med.member_id = eol.INSUREDSIDNUMBER&lt;BR /&gt;145 ;&lt;BR /&gt;NOTE: Table WORK.HPHC_FY20_EOL_COMBINED_V2 created, with 130170 rows and 35 columns.</description>
      <pubDate>Tue, 04 Aug 2020 15:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674404#M203084</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-08-04T15:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting a merge dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674408#M203086</link>
      <description>&lt;P&gt;So that simply means your large table consists mostly of member_id's that have a match in the small table.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-a-merge-dataset/m-p/674408#M203086</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T15:52:50Z</dc:date>
    </item>
  </channel>
</rss>

