<?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 matrices by ID variable in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532608#M4563</link>
    <description>Sorry, it's a mistake. Is there any way to undo and mark the correct answer provided by IanWakeling as solution?&lt;BR /&gt;</description>
    <pubDate>Mon, 04 Feb 2019 16:13:19 GMT</pubDate>
    <dc:creator>kaushik_patra</dc:creator>
    <dc:date>2019-02-04T16:13:19Z</dc:date>
    <item>
      <title>Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532457#M4556</link>
      <description>&lt;P&gt;I have two matrices A and ALS; my goal is to merge rows from ALS matrix where visit = 18 with matrix A by the ID variable. Any tip on how to do it in IML?&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="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26819iAE886AFAAD97022F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&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="image.png" style="width: 186px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26820i2BA2C26E2F9985F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 22:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532457#M4556</guid>
      <dc:creator>kaushik_patra</dc:creator>
      <dc:date>2019-02-03T22:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532469#M4557</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
I have two matrices A and ALS; 
my goal is to merge rows from ALS matrix 
where visit = 18 with matrix A 
by the ID variable. 
Any tip on how to do it in IML?
*/
proc sort data=a out=a_sorted;
	by ID;
run;
proc sort data=als out=als_sorted;
	by ID;
run;
data want;
	merge a_sorted(in=ina)
	      als_sorted;
	 by ID;
	 if ina;
	 if visit=18;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2019 01:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532469#M4557</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-04T01:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532483#M4558</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/119953"&gt;@kaushik_patra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have two matrices A and ALS; my goal is to merge rows from ALS matrix where visit = 18 with matrix A by the ID variable. Any tip on how to do it in IML?&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="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26819iAE886AFAAD97022F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&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="image.png" style="width: 186px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26820i2BA2C26E2F9985F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You've posted this in the IML forum, are you using SAS/IML or SAS Base. Are they matrices in IML or data sets?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have you're trying to score some data, so you may want to consider PROC PLM and/or SCORE or a SCORE statement within whatever procedure you used.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 02:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532483#M4558</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-04T02:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532518#M4559</link>
      <description>&lt;P&gt;If there are no complications, so both matrices are sorted on ID, the set of IDs is the same in both, and ALS contains a visit 18 for every ID, then you could use the LOC function to find the rows in ALS that correspond to the visit 18s.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;A = A || ALS[ loc(ALS[,3]=18), ];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For more complex cases it may&amp;nbsp;be&amp;nbsp;better to do the merging in a data step as also&amp;nbsp;suggested.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 08:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532518#M4559</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2019-02-04T08:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532559#M4560</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 13:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532559#M4560</guid>
      <dc:creator>kaushik_patra</dc:creator>
      <dc:date>2019-02-04T13:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532591#M4562</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/119953"&gt;@kaushik_patra&lt;/a&gt;&amp;nbsp;please don't mark your own answer as correct, mark the answer that helped you solve the issue.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 15:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532591#M4562</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-04T15:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532608#M4563</link>
      <description>Sorry, it's a mistake. Is there any way to undo and mark the correct answer provided by IanWakeling as solution?&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Feb 2019 16:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532608#M4563</guid>
      <dc:creator>kaushik_patra</dc:creator>
      <dc:date>2019-02-04T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Merge matrices by ID variable</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532612#M4564</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/119953"&gt;@kaushik_patra&lt;/a&gt; you can un-select the solution you chose and then reselect the answer that applies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 16:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Merge-matrices-by-ID-variable/m-p/532612#M4564</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-04T16:17:24Z</dc:date>
    </item>
  </channel>
</rss>

