<?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 Data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185545#M47113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls also share some sample input and desired output data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2014 14:56:47 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2014-02-25T14:56:47Z</dc:date>
    <item>
      <title>Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185541#M47109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp; I am trying to merge&amp;nbsp; two datasets.&amp;nbsp; The first contains all occurrences of pregnancy.&amp;nbsp; The second contains therapies.&amp;nbsp; I want to merge the two together by PATID.&amp;nbsp; The problem is there are more therapy dates then there are pregnancies.&amp;nbsp;&amp;nbsp; I want to be able to put all therapies for each occurrence of pregnancy&amp;nbsp; so that i can then see which therapy was taken after a given pregnancy.&amp;nbsp; At the moment however the merge does this&amp;nbsp; - e.g. two pregnancies same PATID 7 therapies same PATID merge together final dataset has 7 rows.&amp;nbsp; i want the final dataset to have 14 rows with the 7 therapies assigned to both rows of pregnancy dataset.&amp;nbsp; Is there a way to do this - maybe using SQL if not SAS.&amp;nbsp; Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185541#M47109</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-02-25T09:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185542#M47110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tell me , if PAT id of two or more pregnancies (as in your example) are same , then both of them have same therapies , or there can be a case where PAT id is same for two pregnancies but therapies might be different. If therapies are same it can be done on SAS as well SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185542#M47110</guid>
      <dc:creator>vishal_prof_gmail_com</dc:creator>
      <dc:date>2014-02-25T09:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185543#M47111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PATID would be the same so for example I would have two pregnancies in the PREG dataset both 101.&amp;nbsp; I would then have 7 therapies in the THERAPY dataset all with PATID 101.&amp;nbsp; So in the merged final dataset I would basically have the therapies duplicated for each pregnancy event.&amp;nbsp; Many thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185543#M47111</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-02-25T09:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185544#M47112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think using a left join would solve the purpose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a.PATID , b.Therapy&lt;/P&gt;&lt;P&gt;from &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PREG&lt;/SPAN&gt; a left join &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;THERAPY&lt;/SPAN&gt; b on a.PATID = b.PATID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that Therapy data set has unique PATIDs. Please share the code you have written.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 10:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185544#M47112</guid>
      <dc:creator>vishal_prof_gmail_com</dc:creator>
      <dc:date>2014-02-25T10:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185545#M47113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls also share some sample input and desired output data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 14:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185545#M47113</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-02-25T14:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185546#M47114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi here is the code I used and it worked perfectly thank you so much for your help.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table Preg_GLP&lt;/P&gt;&lt;P&gt;as select a.*, b.index_date, b.PatBegDate, b.PatEndDate&lt;/P&gt;&lt;P&gt;from&amp;nbsp; Patient_Medication_GLP a left join Patient_Summary_Preg&amp;nbsp; b on a.PATID = b.PATID;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 15:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merging-Data/m-p/185546#M47114</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-02-25T15:22:24Z</dc:date>
    </item>
  </channel>
</rss>

