<?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: Error passing optional parameter to SAS/IML module in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750062#M5503</link>
    <description>&lt;P&gt;Thank you for an informative reply. I misunderstood the syntax in the example contained in the webpage that I cited and thought that I could use the optionality of a parameter the same way that I can use a SAS/Macro keyword parameter.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 00:43:56 GMT</pubDate>
    <dc:creator>rbettinger</dc:creator>
    <dc:date>2021-06-24T00:43:56Z</dc:date>
    <item>
      <title>Error passing optional parameter to SAS/IML module</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750025#M5501</link>
      <description>&lt;P&gt;I have written a SAS/IML module to print a matrix using an optional parameter list. The module is quite simple:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;proc iml ;&lt;BR /&gt;a={1 2 3, 4 5 6} ;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;start print_mat( matrix= ) ;&lt;BR /&gt;print 'isSkipped=' (isSkipped( matrix )) ;&lt;BR /&gt;print 'isEmpty =' (isEmpty ( matrix )) ;&lt;BR /&gt;print 'matrix=' matrix ;&lt;BR /&gt;finish ;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;run print_mat( a ) ;&lt;BR /&gt;run print_mat( matrix=a ) ;&lt;BR /&gt;quit ;&lt;/P&gt;&lt;P&gt;and it works for the first invocation of print_mat without the optional parameter syntax, but stumbles for the second invocation where the optional parameter list syntax is used. I do not understand why I get the following error message:&lt;/P&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;205 run print_mat( matrix=a ) ;&lt;/DIV&gt;&lt;DIV class="sasError lia-indent-padding-left-30px"&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;operation : = at line 205 column 22&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;operands : matrix, a&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;matrix 0 row 0 col (type ?, size 0)&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;a 2 rows 3 cols (numeric)&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;1 2 3&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;4 5 6&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;statement : RUN at line 205 column 1&lt;/DIV&gt;&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;206 quit ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Why is 'matrix' considered to be an operand? Why is it considered to be empty?&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;The error message indicates that the input parameter, matrix, does not point to matrix a. What am I failing to understand about the optional parameter list syntax?&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Dr. Wicklin has explained how to use the optional parameter list here: &lt;A href="https://blogs.sas.com/content/iml/2015/02/02/detect-empty-module-params.html," target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2015/02/02/detect-empty-module-params.html,&lt;/A&gt; and I have modeled my module after his example. Please help my poor neuron to comprehend my error. Thanks!&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 20:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750025#M5501</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-06-23T20:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error passing optional parameter to SAS/IML module</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750056#M5502</link>
      <description>&lt;P&gt;Unlike a SAS macro, which supports both positional and keyword syntax, a SAS/IML function only supports positional parameters. You can't call the function by using&lt;/P&gt;
&lt;P&gt;run print_mat( matrix=a );&lt;/P&gt;
&lt;P&gt;only by using&lt;/P&gt;
&lt;P&gt;run print_matrix(a);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you use that syntax, SAS tries to evaluate the expression "matrix=a", which is a boolean matrix, so that it can pass the appropriate matrix to the function.&amp;nbsp; However, there is no variable named 'matrix', so the expression "matrix=a" results in an error.&amp;nbsp; It's the same error you will get if you run&lt;/P&gt;
&lt;P&gt;y = (matrix=a);&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 23:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750056#M5502</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-06-23T23:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error passing optional parameter to SAS/IML module</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750062#M5503</link>
      <description>&lt;P&gt;Thank you for an informative reply. I misunderstood the syntax in the example contained in the webpage that I cited and thought that I could use the optionality of a parameter the same way that I can use a SAS/Macro keyword parameter.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 00:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/750062#M5503</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-06-24T00:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error passing optional parameter to SAS/IML module</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/751516#M5504</link>
      <description>&lt;P&gt;If you do not have other questions, please close this thread.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-passing-optional-parameter-to-SAS-IML-module/m-p/751516#M5504</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-07-01T17:54:28Z</dc:date>
    </item>
  </channel>
</rss>

