<?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 Duplicate rows after merging two datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794885#M254903</link>
    <description>&lt;P&gt;I have one file that contains parameter estimates (36 different values) [this is the screenshot called ‘merged estimates’. This file does not contain any patient IDs, demographics, etc.&lt;/P&gt;&lt;P&gt;I have a second file that contains my study sample sorted by patient ID (9,965 participants). I would like to merge both files so that each participant has the same sequence of 36 values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current output only has the sequence of 36 values for the 1st observation [second screenshot called ‘merged dataset’].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I was trying to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data createBAestimate ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; merge V12 mergeestimate ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i = 1 to 9965 ;&lt;/P&gt;&lt;P&gt;output ;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged estimates.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68264iF98FBD42E13AA7D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged estimates.jpg" alt="Merged estimates.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged dataset.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68265i203E515C7E5C701A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged dataset.jpg" alt="Merged dataset.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 22:36:34 GMT</pubDate>
    <dc:creator>talktorob</dc:creator>
    <dc:date>2022-02-07T22:36:34Z</dc:date>
    <item>
      <title>Duplicate rows after merging two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794885#M254903</link>
      <description>&lt;P&gt;I have one file that contains parameter estimates (36 different values) [this is the screenshot called ‘merged estimates’. This file does not contain any patient IDs, demographics, etc.&lt;/P&gt;&lt;P&gt;I have a second file that contains my study sample sorted by patient ID (9,965 participants). I would like to merge both files so that each participant has the same sequence of 36 values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current output only has the sequence of 36 values for the 1st observation [second screenshot called ‘merged dataset’].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I was trying to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data createBAestimate ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; merge V12 mergeestimate ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i = 1 to 9965 ;&lt;/P&gt;&lt;P&gt;output ;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged estimates.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68264iF98FBD42E13AA7D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged estimates.jpg" alt="Merged estimates.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged dataset.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68265i203E515C7E5C701A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged dataset.jpg" alt="Merged dataset.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 22:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794885#M254903</guid>
      <dc:creator>talktorob</dc:creator>
      <dc:date>2022-02-07T22:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows after merging two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794887#M254904</link>
      <description>&lt;P&gt;You can't merge in one row to a full data set this way. &lt;BR /&gt;This will work for you though:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data createBAestimate;
set V12;
if _n_ =1 then set mergeestimate;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Without a BY statement, the merge operates by position, on a line by line merge so the first rows are merged and then nothing as you've seen.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FYI if you're trying to score data, look into PROC PLM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/248197"&gt;@talktorob&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have one file that contains parameter estimates (36 different values) [this is the screenshot called ‘merged estimates’. This file does not contain any patient IDs, demographics, etc.&lt;/P&gt;
&lt;P&gt;I have a second file that contains my study sample sorted by patient ID (9,965 participants). I would like to merge both files so that each participant has the same sequence of 36 values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My current output only has the sequence of 36 values for the 1st observation [second screenshot called ‘merged dataset’].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for your suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I was trying to no avail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data createBAestimate ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; merge V12 mergeestimate ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do i = 1 to 9965 ;&lt;/P&gt;
&lt;P&gt;output ;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged estimates.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68264iF98FBD42E13AA7D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged estimates.jpg" alt="Merged estimates.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Merged dataset.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68265i203E515C7E5C701A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Merged dataset.jpg" alt="Merged dataset.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 22:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794887#M254904</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-07T22:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows after merging two datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794889#M254905</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your explanation. Your code worked! Much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 22:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Duplicate-rows-after-merging-two-datasets/m-p/794889#M254905</guid>
      <dc:creator>talktorob</dc:creator>
      <dc:date>2022-02-07T22:45:18Z</dc:date>
    </item>
  </channel>
</rss>

