<?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 Update dataset (argument to macro) in each do loop inside PROC IML. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520977#M4130</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that takes a dataset, and few other as arguments. I am inside a PROC IML. I am using a do loop and inside a do loop, I am calling a macro that I have already created. How can I update the data set in each loop so that updated data set can be used each time in the loop when I call the macro?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 20:15:28 GMT</pubDate>
    <dc:creator>themanoj20080</dc:creator>
    <dc:date>2018-12-12T20:15:28Z</dc:date>
    <item>
      <title>Update dataset (argument to macro) in each do loop inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520977#M4130</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that takes a dataset, and few other as arguments. I am inside a PROC IML. I am using a do loop and inside a do loop, I am calling a macro that I have already created. How can I update the data set in each loop so that updated data set can be used each time in the loop when I call the macro?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520977#M4130</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T20:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset (argument to macro) in each do loop inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520991#M4131</link>
      <description>&lt;P&gt;I can't imagine this.. Can you post your code please?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520991#M4131</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-12T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset (argument to macro) in each do loop inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520993#M4132</link>
      <description>Hi:&lt;BR /&gt;  There is a separate forum for IML users: &lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml&lt;/A&gt; your question might be viewed by more IML users in that forum.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 12 Dec 2018 20:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/520993#M4132</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-12T20:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset (argument to macro) in each do loop inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/521001#M4133</link>
      <description>&lt;P&gt;If your macro contains any PROC or DATA step blocks it will halt the Proc Iml executing when encounter if it doesn't create an error condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just like when I run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data junk;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if sex='F' then weight=weight-1;&lt;/P&gt;
&lt;P&gt;proc print data=junk;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS system when it encounters the PROC "knows" that you intended to end the data step and implies a "run;" statement.&lt;/P&gt;
&lt;P&gt;Similarly if another Data step definition is encountered the same thing happens with the currently executing data step or proc terminating so the new data step can start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would have to post the entire code of the IML attempting to call the macro and the macro definition(s) to see what alternate ideas may be practical.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/521001#M4133</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-12T20:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset (argument to macro) in each do loop inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/521007#M4136</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Here is the example. I have a macro and proc iml. In the PROC IML, after the loop ends I want five different means but I am not getting that.
%macro hello(X);
use &amp;amp;dataset; read all var{&amp;amp;X} into A;
m=mean(A);
print m;
%mend hello;

proc iml;
do i = 1 to 5;
X=randnormal(10,0,1);
firstcol=X[,1];
create newdata var{firstcol};
append;
close;
%let dataset=newdata;
%hello(firstcol);
call delete(dataset);
end;
quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-dataset-argument-to-macro-in-each-do-loop-inside-PROC-IML/m-p/521007#M4136</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T21:06:35Z</dc:date>
    </item>
  </channel>
</rss>

