<?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: (execution) Matrix has not been set to a value. in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233851#M2483</link>
    <description>&lt;P&gt;Whoa! Thanks very much &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank"&gt;@Rick_SAS&lt;/A&gt;!! Really.&lt;/P&gt;&lt;P&gt;I did not know about the tip:&lt;/P&gt;&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;"Arr = rfss##apf;"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That's helpful.&lt;/P&gt;&lt;P&gt;And sorry, if I opened this old discussion. I actually did not know how to open a new one. But now I do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raphael&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2015 15:37:47 GMT</pubDate>
    <dc:creator>NewbieRaph</dc:creator>
    <dc:date>2015-11-09T15:37:47Z</dc:date>
    <item>
      <title>ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110880#M833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new in using SAS. Running somebody else code and I see this error in the middle of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110880#M833</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-05-10T19:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110881#M834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This occurs when you try to assign or print a matrix that has not been assigned.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;y = x; /* x has not been assigned */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110881#M834</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-05-10T19:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110882#M835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110882#M835</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-05-10T19:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110883#M836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the macro and all values to be sent to macro is provided prior in the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro addmargins(fob,truck,rail,water,air,pipe,whole,ret,fsv,filter=(1:num_sectors));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector = J(1,num_sectors,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector[&amp;amp;filter] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus = diag(selector) * &amp;amp;fob;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* transportation margins */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[truck_row,] = Yplus[truck_row,] + selector * &amp;amp;truck;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[air_row,] = Yplus[air_row,] + selector * &amp;amp;air;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[water_row,] = Yplus[water_row,] + selector * &amp;amp;water;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[rail_row,] = Yplus[rail_row,] + selector * &amp;amp;rail;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[pipe_row,] = Yplus[pipe_row,] + selector * &amp;amp;pipe;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[fsv_row,] = Yplus[fsv_row,] + selector * &amp;amp;fsv;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* wholesale &amp;amp; retail utility and non-utility expenditure */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[tgas_row,] = Yplus[tgas_row,] + &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector * (diag(fuel_w) * &amp;amp;whole + diag(fuel_r) * &amp;amp;ret);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[telec_row,] = Yplus[telec_row,] +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector * (diag(elec_w) * &amp;amp;whole + diag(elec_r) * &amp;amp;ret);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[whole_row,] = Yplus[whole_row,] + &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector * ((I(num_sectors) - diag(elec_w + fuel_w)) * &amp;amp;whole);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yplus[retail_row,] = Yplus[retail_row,] + &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selector * ((I(num_sectors) - diag(elec_r + fuel_r)) * &amp;amp;ret);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here is when error happens:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3526&amp;nbsp; /*Read in macro to compute and add margin costs to PCE columns*/&lt;/P&gt;&lt;P&gt;3527&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %include 'C:\Users\hze1\Desktop\SAS\FMB addmargins macro.sas';&lt;/P&gt;&lt;P&gt;3549&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %addmargins(fob=Y_nipa, truck=N_truck, rail=N_rail,&lt;/P&gt;&lt;P&gt;3550&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; water=N_water, air=N_air, pipe=N_pipe,&lt;/P&gt;&lt;P&gt;3551&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whole=N_whole, ret=N_ret, fsv=N_fsv);&lt;/P&gt;&lt;P&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; operation : [ at line 3549 column 5&lt;/P&gt;&lt;P&gt; operands&amp;nbsp; : Yplus, fsv_row,&lt;/P&gt;&lt;P&gt;Yplus&amp;nbsp;&amp;nbsp;&amp;nbsp; 392 rows&amp;nbsp;&amp;nbsp;&amp;nbsp; 228 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fsv_row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 col&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; statement : ASSIGN at line 3549 column 5&lt;/P&gt;&lt;P&gt;ERROR: (execution) Matrices do not conform to the operation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110883#M836</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-05-10T19:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110884#M837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tenth line of the macro is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Yplus[fsv_row,] = Yplus[fsv_row,] + selector * &amp;amp;fsv;&lt;/P&gt;&lt;P&gt;On that line, the variable fsv_row has not been set to a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to read this article on "&lt;A href="http://blogs.sas.com/content/iml/2010/11/29/how-to-interpret-sasiml-error-messages/"&gt;How to interpret SAS/IML error messages&lt;/A&gt;."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110884#M837</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-05-10T19:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110885#M838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On the tenth line exactly same thing happening that is happening on the above lines in macro:-(&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 20:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110885#M838</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-05-10T20:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110886#M839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand your response. I am telling you where the error occurs. You haven't provided enough information to know WHY the error is occuring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to send more of the SAS Log.&amp;nbsp; If necessary, look up the the SAS system options MLOGIC, MPRINT, and SYMBOLGEN. They are sometimes helpful in debugging macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, asking the person who wrote the code might help. It's possible that you are using his macro incorrectly or forgot to set some option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 20:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/110886#M839</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-05-10T20:46:55Z</dc:date>
    </item>
    <item>
      <title>ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233424#M2461</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to the SAS community.&lt;/P&gt;&lt;P&gt;I am a SAS user (Enterprise Guide 5.1) and I am encountering a problem with SAS IML.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Error message:&amp;nbsp;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; " ERROR: (execution) Matrix has not been set to a value."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Extract of code:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc iml ;&lt;/P&gt;&lt;P&gt;use KERNEL.RFSS&amp;amp;simu.;&lt;BR /&gt;read all var _ALL_ into rfss;&lt;BR /&gt;close;&lt;BR /&gt;/*start transpose(rfss);&lt;BR /&gt;t_rfss=T(rfss);&lt;BR /&gt;return(t_rfss);&lt;BR /&gt;finish;*/&lt;BR /&gt;&lt;BR /&gt;use KERNEL.apf2;&lt;BR /&gt;read all var _ALL_ into apf;&lt;BR /&gt;close;&lt;BR /&gt;&lt;BR /&gt;use KERNEL.lapf2;&lt;BR /&gt;read all var _ALL_ into lapf;&lt;BR /&gt;close;&lt;BR /&gt;&lt;BR /&gt;use KERNEL.lpf2;&lt;BR /&gt;read all var _ALL_ into lpf;&lt;BR /&gt;close;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Arr=repeat(0,NROW(apf),NCOL(apf));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;n_mon=NROW(apf);&lt;BR /&gt;n_rf=NCOL(apf);&lt;BR /&gt;%put n_mon;&lt;BR /&gt;%put n_rf;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%do r=1 %to &amp;amp;Nrf.;&lt;BR /&gt;&lt;STRONG&gt;Arr[1:NROW(apf),r] = rfss[r]**apf[1:NROW(apf),r];&lt;/STRONG&gt;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create results&amp;amp;simu.&lt;BR /&gt;from Arr;&lt;BR /&gt;append from Arr;&lt;BR /&gt;close;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code executes well when I deactivate the part in bold.&lt;/P&gt;&lt;P&gt;I read a lot of debugging hints on this&amp;nbsp;website. But I still do not have a solution to the&amp;nbsp;problem.&lt;/P&gt;&lt;P&gt;At first, I thought it was a dimension problem. &amp;nbsp;Then I put all the matices &lt;STRONG&gt;apf &lt;/STRONG&gt;and&lt;STRONG&gt; Arr&lt;/STRONG&gt; to the same dimensions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think there is a problem with the dimension of vector&amp;nbsp;&lt;STRONG&gt;rfss[r] &lt;/STRONG&gt;? The idea here is to raise each component of&amp;nbsp;&lt;STRONG&gt;rfss[r]&lt;/STRONG&gt; to the power at each column of matrix&lt;STRONG&gt; apf.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks so much for your help.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Oh yeah: apf &lt;/STRONG&gt;has 20,000 rows and 96 columns.&lt;STRONG&gt;&amp;nbsp;rfss[r] &lt;/STRONG&gt;has 1 row and 96 columns and&lt;STRONG&gt; Arr &lt;/STRONG&gt;is supposed to be a &amp;nbsp;&lt;STRONG&gt;20,000 rows X&amp;nbsp;96 columns matrix.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Raphael&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 13:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233424#M2461</guid>
      <dc:creator>NewbieRaph</dc:creator>
      <dc:date>2015-11-06T13:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233453#M2462</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61145"&gt;@NewbieRaph﻿&lt;/a&gt;. Welcome to SAS and IML.&amp;nbsp; I'll answer your question, but in the future please open a new discussion rather than appending to a thread that has been closed for three years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, there is no need for a macro loop. The SAS/IML loop has a DO loop that will enable you to perform this calulation without using macro. (The macro loop is also inefficient, since it generates 96 separate statements that have to be parsed and executed.)&lt;/P&gt;
&lt;P&gt;Here's how to use a DO loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
apf = {1 2 3,
       4 5 6};
rfss = {2 3 4};&lt;BR /&gt;
Arr=repeat(0,NROW(apf),NCOL(apf));
do r=1 to ncol(apf);
  Arr[1:NROW(apf),r] = rfss[r]**apf[1:NROW(apf),r];
end;
print Arr;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Second, for this computation, you actually don't need any loop. SAS/IML is a matrix language, which means it can perform matrix and vector computation.&amp;nbsp; The elementwise power operator is ##, which you can use to raise each element of a vector to a power. (The '**' operator is for repeated matrix multiplication.) Thus your program reduces to the one-liner:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Arr = rfss##apf;
print Arr;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For more details, see the article &lt;A href="http://blogs.sas.com/content/iml/2010/12/06/shorthand-notation-for-row-and-column-operations.html" target="_self"&gt;"Shorthand notation for row and column operations."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 15:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233453#M2462</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-11-06T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: (execution) Matrix has not been set to a value.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233851#M2483</link>
      <description>&lt;P&gt;Whoa! Thanks very much &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684" target="_blank"&gt;@Rick_SAS&lt;/A&gt;!! Really.&lt;/P&gt;&lt;P&gt;I did not know about the tip:&lt;/P&gt;&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;"Arr = rfss##apf;"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That's helpful.&lt;/P&gt;&lt;P&gt;And sorry, if I opened this old discussion. I actually did not know how to open a new one. But now I do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raphael&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 15:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/ERROR-execution-Matrix-has-not-been-set-to-a-value/m-p/233851#M2483</guid>
      <dc:creator>NewbieRaph</dc:creator>
      <dc:date>2015-11-09T15:37:47Z</dc:date>
    </item>
  </channel>
</rss>

