<?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: SAS IML - Creating matrices dynamically into a DO Loop in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942831#M6279</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;

M="MAT_1":"MAT_10"; 
DO X = 1 TO ncol(M);
 call valset(M[X],J(2,rand('integer',1,4), 1));
 print (value(M[X]));
END;

QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Sep 2024 01:57:26 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-09-06T01:57:26Z</dc:date>
    <item>
      <title>SAS IML - Creating matrices dynamically into a DO Loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942828#M6278</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m not that used with SAS IML syntax and I’m trying to do something that seems to be very simple: creating matrices dynamically into a Do Loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I’m trying to do is using the iterator number as part of the matrix names (because I will create a bunch of matrices, as I said, dynamically) but I just can’t figure out how.&lt;/P&gt;&lt;P&gt;Here is a simple example of how it should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC IML;

DO X = 1 TO 10;
      MAT_&amp;amp;X. = J(10, 20, 1); /*or something like that…*/
END;&lt;BR /&gt;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words, I just would like to concatenate “MAT_” with the iteration number to name the matrix, but I’m failing miserably…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with this issue, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I'm using the IML languague into SAS Guide scripts.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 01:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942828#M6278</guid>
      <dc:creator>Felipe_bortolo</dc:creator>
      <dc:date>2024-09-06T01:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS IML - Creating matrices dynamically into a DO Loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942831#M6279</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;

M="MAT_1":"MAT_10"; 
DO X = 1 TO ncol(M);
 call valset(M[X],J(2,rand('integer',1,4), 1));
 print (value(M[X]));
END;

QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2024 01:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942831#M6279</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-06T01:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS IML - Creating matrices dynamically into a DO Loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942843#M6280</link>
      <description>&lt;P&gt;Can you say more about what you intend to do with these matrices?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen a few cases where the programmer thinks he needs to do. But in most cases, the program only requires one matrix at a time. If that i the case for your application, create the matrix, M, inside the loop, use it, and then use the same name for the next iteration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've also seen applications where the program requires M_new and M_old. If that is the case, set M_old=M_new at the bottom of the DO loop, and reassign M_new at the top of the loop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 03:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Creating-matrices-dynamically-into-a-DO-Loop/m-p/942843#M6280</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-09-06T03:24:51Z</dc:date>
    </item>
  </channel>
</rss>

