<?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: MERGE table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775189#M31295</link>
    <description>Yes that works. Thank you</description>
    <pubDate>Tue, 19 Oct 2021 18:06:15 GMT</pubDate>
    <dc:creator>Hani18</dc:creator>
    <dc:date>2021-10-19T18:06:15Z</dc:date>
    <item>
      <title>MERGE table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775183#M31291</link>
      <description>&lt;P&gt;hello, i'm having troulbe get the table merge with the two different scores which looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hani18_0-1634664376006.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64857iF4050C30DDF869DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hani18_0-1634664376006.png" alt="Hani18_0-1634664376006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data exercise4;
 input ID $ KneeNumber PreOp OneDay OneWeek OneMonth;
cards;
01 1 0  5  7  10
02 1 0 10 15  15
02 2 3  5  8  10
03 1 0  3  3   3
03 2 0  6  9   9
04 1 0  4 10  10
;
data A (keep=id visit score);
 set exercise4;
 array x{4} PreOp OneDay OneWeek OneMonth;
   do i=1 to 4;
   visit = i;
   score = x{i};
   if kneenumber = 1;
     output;
     end;
run;
data B (keep=id visit score);
 set exercise4;
 array x{4} PreOp OneDay OneWeek OneMonth;
   do i=1 to 4;
   visit = i;
   score = x{i};
   if kneenumber = 2;
     output;
     end;
run;

data merged;
merge A B;
by id;
run;

proc print data=merged;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and this is my output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hani18_1-1634664434568.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64858iD6385377F08C45A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hani18_1-1634664434568.png" alt="Hani18_1-1634664434568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 17:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775183#M31291</guid>
      <dc:creator>Hani18</dc:creator>
      <dc:date>2021-10-19T17:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: MERGE table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775185#M31293</link>
      <description>&lt;P&gt;is the first screenshot your desired output? You have score named the same in both datasets. you should use the rename statement and rename them to score_knee1 and score_knee2 if that is what you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 17:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775185#M31293</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-10-19T17:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: MERGE table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775189#M31295</link>
      <description>Yes that works. Thank you</description>
      <pubDate>Tue, 19 Oct 2021 18:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/MERGE-table/m-p/775189#M31295</guid>
      <dc:creator>Hani18</dc:creator>
      <dc:date>2021-10-19T18:06:15Z</dc:date>
    </item>
  </channel>
</rss>

