<?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: Merging Issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345489#M273150</link>
    <description>&lt;P&gt;That did it!&amp;nbsp; Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 18:13:34 GMT</pubDate>
    <dc:creator>moreilly</dc:creator>
    <dc:date>2017-03-29T18:13:34Z</dc:date>
    <item>
      <title>Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345455#M273146</link>
      <description>&lt;P&gt;I am working with Medicare claims data and am trying to merge two datasets (TRIGGERS and CLAIMS).&amp;nbsp; TRIGGERS has the variables bene_id, claim_id and date.&amp;nbsp; In TRIGGERS there is one claim (observation) per bene_id.&amp;nbsp; CLAIMS has bene_id, claim_id, date and diagnostic codes. In CLAIMS, each bene_id may have multiple claims (multiple observations).&amp;nbsp; I want to create a new dataset, LOOKBACK, that keeps only the bene_ids that are in both TRIGGERS and CLAIMS and keeps multiple claims (observations) for every bene_id.&amp;nbsp; I expected the following code to work, but I seemed to lose the claim from TRIGGER.&amp;nbsp; Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;proc sort data = out.triggers; by bene_id; run;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;proc sort data = work.claims; by bene_id; run;&lt;BR /&gt;&lt;BR /&gt;data lookback;&lt;BR /&gt;merge out.triggers (in=a) work.claims (in=b);&lt;BR /&gt;by bene_id; if a and b;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 16:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345455#M273146</guid>
      <dc:creator>moreilly</dc:creator>
      <dc:date>2017-03-29T16:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345469#M273147</link>
      <description>&lt;P&gt;What does the log say? If none of these match you should be getting zero obs due to the "if a and b;" Have you compared the values for&amp;nbsp;&lt;SPAN&gt;bene_id in both data sets to make sure they have any overlap at all?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345469#M273147</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-29T17:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345473#M273148</link>
      <description>&lt;P&gt;Your final data set can only have one variable named CLAIM_ID.&amp;nbsp; If it appears in both data sets and you want both, this is one possible change to handle it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;merge out.triggers (in=a&lt;FONT color="#ff00ff"&gt; rename=(claim_id=trigger_claim_id)&lt;/FONT&gt;) work.claims (in=b);&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345473#M273148</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-29T17:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345475#M273149</link>
      <description>&lt;P&gt;There is overlap.&amp;nbsp; This is the log message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 711292 observations read from the data set TRIGGERS.&lt;BR /&gt;NOTE: There were 86214334 observations read from the data set CLAIMS.&lt;BR /&gt;NOTE: The data set WORK.LOOKBACK has 23448038 observations and 17 variables.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But, when I look at the data, the date from the TRIGGER observation has been lost.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345475#M273149</guid>
      <dc:creator>moreilly</dc:creator>
      <dc:date>2017-03-29T17:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345489#M273150</link>
      <description>&lt;P&gt;That did it!&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 18:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Issue/m-p/345489#M273150</guid>
      <dc:creator>moreilly</dc:creator>
      <dc:date>2017-03-29T18:13:34Z</dc:date>
    </item>
  </channel>
</rss>

