<?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: Do loop proc IML with  ImportDataSetFromR in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681015#M5259</link>
    <description>&lt;P&gt;That syntax is not valid. There is no macro variable named 'i', so &amp;amp;i is null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you are importing table_w as a data set, so the expression nrow(table_a) equals 0. Maybe you meant to import it as a matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what names you want to read, but here is some sample code that might help you figure it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
table_w = {'A', 'My_results', 'More_results'};
do i=1 to nrow(table_w); 
   dsName = strip(table_w[i]);
   print i dsName;
   *call ImportDataSetFromR(dsName,dsName); /* uncomment when ready */
end;

/* or if the tables are named table_w1, table_w2, etc */
do i=1 to nrow(table_w); 
   dsName = "table_w" + strip(char(i));
   print i dsName;
   *call ImportDataSetFromR(dsName,dsName); /* uncomment when ready */ 
end;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2020 14:30:24 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-09-02T14:30:24Z</dc:date>
    <item>
      <title>Do loop proc IML with  ImportDataSetFromR</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681004#M5257</link>
      <description>&lt;P&gt;Hi im trying to import to sas some tables that are in R named: table_1 , table_2 , table_3 etc.&lt;/P&gt;&lt;P&gt;I need to do this with a loop because the number of tables will depend of de number of rows of another table (table_w). i imagine it would be something like :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call ImportDataSetFromR("table_w","table_w"); 
do i=1 to nrow(table_w); &lt;BR /&gt;call ImportDataSetFromR("table_"&amp;amp;i,"table_"&amp;amp;i); 
end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but when i run it it has no errors but the are no tables in work.&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 14:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681004#M5257</guid>
      <dc:creator>ManuelaVila</dc:creator>
      <dc:date>2020-09-02T14:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop proc IML with  ImportDataSetFromR</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681006#M5258</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334826"&gt;@ManuelaVila&lt;/a&gt;&amp;nbsp;I moved this thread to the IMl forum.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 14:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681006#M5258</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-09-02T14:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop proc IML with  ImportDataSetFromR</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681015#M5259</link>
      <description>&lt;P&gt;That syntax is not valid. There is no macro variable named 'i', so &amp;amp;i is null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you are importing table_w as a data set, so the expression nrow(table_a) equals 0. Maybe you meant to import it as a matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what names you want to read, but here is some sample code that might help you figure it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
table_w = {'A', 'My_results', 'More_results'};
do i=1 to nrow(table_w); 
   dsName = strip(table_w[i]);
   print i dsName;
   *call ImportDataSetFromR(dsName,dsName); /* uncomment when ready */
end;

/* or if the tables are named table_w1, table_w2, etc */
do i=1 to nrow(table_w); 
   dsName = "table_w" + strip(char(i));
   print i dsName;
   *call ImportDataSetFromR(dsName,dsName); /* uncomment when ready */ 
end;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 14:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-loop-proc-IML-with-ImportDataSetFromR/m-p/681015#M5259</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-09-02T14:30:24Z</dc:date>
    </item>
  </channel>
</rss>

