<?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 SAS Macro inside PROC IML. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520959#M4126</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use a macro inside PROC IML and it is giving me an error. Suppose I created a macro named mymacro and I call this macro inside proc iml. I would think 4 will be returned 5 times but it is not. Can anyone explain why this is not working?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;%macro mymacro(A,Y=2);
proc iml;
Z=&amp;amp;A+&amp;amp;Y;
print Z;
quit;
%mend mymacro;

proc iml;
do i = 1 to 5;
%mymacro(2);
end;
quit;&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Dec 2018 19:13:19 GMT</pubDate>
    <dc:creator>themanoj20080</dc:creator>
    <dc:date>2018-12-12T19:13:19Z</dc:date>
    <item>
      <title>SAS Macro inside PROC IML.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520959#M4126</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use a macro inside PROC IML and it is giving me an error. Suppose I created a macro named mymacro and I call this macro inside proc iml. I would think 4 will be returned 5 times but it is not. Can anyone explain why this is not working?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;%macro mymacro(A,Y=2);
proc iml;
Z=&amp;amp;A+&amp;amp;Y;
print Z;
quit;
%mend mymacro;

proc iml;
do i = 1 to 5;
%mymacro(2);
end;
quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520959#M4126</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T19:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML inside SAS Macro.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520961#M4127</link>
      <description>&lt;P&gt;Try this change to your MYMACRO macro. You only need to call PROC IML once:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymacro(A,Y=2);
Z=&amp;amp;A+&amp;amp;Y;
print Z;
%mend mymacro;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520961#M4127</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-12-12T19:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML inside SAS Macro.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520963#M4128</link>
      <description>&lt;P&gt;Got it. Thank you so much.&amp;nbsp;Is this always the case that I don't have to use PROC IML inside a macro?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520963#M4128</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T19:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML inside SAS Macro.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520964#M4129</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250512"&gt;@themanoj20080&lt;/a&gt;&amp;nbsp;- Yes, it depends what you want your macro to do. In your case the macro generates statements inside a single PROC IML step so you leave out &lt;SPAN&gt;PROC IML and QUIT statements.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another time you might want to run PROC IML multiple times say with slightly different statements - in this case your macro would include PROC IML and QUIT statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Macro-inside-PROC-IML/m-p/520964#M4129</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-12-12T19:27:04Z</dc:date>
    </item>
  </channel>
</rss>

