<?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: Question for SAS IML function in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question-for-SAS-IML-function/m-p/378170#M3618</link>
    <description>&lt;P&gt;Yes. Every argument to an IML module can be modified inside the module. For a discussion see &lt;A href="http://blogs.sas.com/content/iml/2011/02/07/passing-arguments-by-reference-an-efficient-choice.html" target="_self"&gt;"Passing arguments by reference: An efficient choice."&lt;/A&gt;&amp;nbsp; The last section of the same article discusses how a programmer that is creating a module can make sure that&amp;nbsp;input arguments are not modified. In your example, the technique would be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;start sum_square(c,_a,b);
a = _a+1;
c = (a+b)**2;
finish;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The SAS/IML documentation also contains &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_programstatements_sect014.htm" target="_self"&gt;an example and discussion of passing arguments&amp;nbsp;by reference.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2017 14:55:42 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-07-21T14:55:42Z</dc:date>
    <item>
      <title>Question for SAS IML function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question-for-SAS-IML-function/m-p/378166#M3617</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc IML;
a=1;
b=2;
start sum_square(c,a,b);
a = a+1;
c = (a+b)**2;
finish;

run sum_square(c,a,b);
print a c;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found an issue with the SAS IML function that the input value of the function would be changed if the input value is overrided inside the function. In the example code, I actually do not want to modify the value of "a" after the function is run, however,&amp;nbsp;"a" is&amp;nbsp;changed to 2 when I print at the bottom of the code. Is there anyway that I can&amp;nbsp;avoid to override the input? In matlab, the input&amp;nbsp;value would not change&amp;nbsp;even if&amp;nbsp;it is modified in a function. Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 14:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question-for-SAS-IML-function/m-p/378166#M3617</guid>
      <dc:creator>jazhang</dc:creator>
      <dc:date>2017-07-21T14:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question for SAS IML function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question-for-SAS-IML-function/m-p/378170#M3618</link>
      <description>&lt;P&gt;Yes. Every argument to an IML module can be modified inside the module. For a discussion see &lt;A href="http://blogs.sas.com/content/iml/2011/02/07/passing-arguments-by-reference-an-efficient-choice.html" target="_self"&gt;"Passing arguments by reference: An efficient choice."&lt;/A&gt;&amp;nbsp; The last section of the same article discusses how a programmer that is creating a module can make sure that&amp;nbsp;input arguments are not modified. In your example, the technique would be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;start sum_square(c,_a,b);
a = _a+1;
c = (a+b)**2;
finish;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The SAS/IML documentation also contains &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_programstatements_sect014.htm" target="_self"&gt;an example and discussion of passing arguments&amp;nbsp;by reference.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 14:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question-for-SAS-IML-function/m-p/378170#M3618</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-07-21T14:55:42Z</dc:date>
    </item>
  </channel>
</rss>

