<?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 IML Memory Issue in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21980#M83</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been a IML user for years.&lt;/P&gt;&lt;P&gt;However, I recently encountered a very weird problem when using IML on the linux system.&lt;/P&gt;&lt;P&gt;Basically I wrote a sas program for a new estimation method created with macros and IML, and then did some simulations on linux system. &lt;/P&gt;&lt;P&gt;The SAS IML was failed with the error message as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: (execution) Unable to allocate sufficient memory. At least 3115064 more bytes required.&lt;/P&gt;&lt;P&gt;operation : CHOOSE at line 578 column 167&lt;/P&gt;&lt;P&gt;operands&amp;nbsp; : _TEM1001, *LIT1083, dwn&lt;/P&gt;&lt;P&gt;_TEM1001&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 rows&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LIT1083&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 col&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;dwn&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 rows&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above message, the corresponding codes in my program is "dwn=choose(wn=.,0,wn);" where wn is a 624*624 matrix.&lt;/P&gt;&lt;P&gt;Well, the point is that I did the same simulations (same codes on same server, I promise) last Nov, but everything was fine without memory problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the information about the sas version and the linux system I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last Nov. :&lt;/P&gt;&lt;P&gt;NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) &lt;/P&gt;&lt;P&gt;NOTE: This session is executing on the &lt;SPAN style="color: #ff0000;"&gt;Linux 2.6.18-238.9.1.el5 (LIN X64) platform&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recently:&lt;/P&gt;&lt;P&gt;NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) &lt;/P&gt;&lt;P&gt;NOTE: This session is executing on the &lt;SPAN style="color: #ff0000;"&gt;Linux 2.6.18-274.7.1.el5 (LIN X64) platform&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the 'out of memory' issue really result from the system difference?&lt;/P&gt;&lt;P&gt;Any clue?&lt;/P&gt;&lt;P&gt;I have been struggling with this problem for a while.&lt;/P&gt;&lt;P&gt;I would appreciate anyone who can help out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vivian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Mar 2012 11:50:28 GMT</pubDate>
    <dc:creator>Vivian</dc:creator>
    <dc:date>2012-03-05T11:50:28Z</dc:date>
    <item>
      <title>SAS IML Memory Issue</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21980#M83</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been a IML user for years.&lt;/P&gt;&lt;P&gt;However, I recently encountered a very weird problem when using IML on the linux system.&lt;/P&gt;&lt;P&gt;Basically I wrote a sas program for a new estimation method created with macros and IML, and then did some simulations on linux system. &lt;/P&gt;&lt;P&gt;The SAS IML was failed with the error message as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: (execution) Unable to allocate sufficient memory. At least 3115064 more bytes required.&lt;/P&gt;&lt;P&gt;operation : CHOOSE at line 578 column 167&lt;/P&gt;&lt;P&gt;operands&amp;nbsp; : _TEM1001, *LIT1083, dwn&lt;/P&gt;&lt;P&gt;_TEM1001&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 rows&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LIT1083&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 col&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;dwn&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 rows&amp;nbsp;&amp;nbsp;&amp;nbsp; 624 cols&amp;nbsp;&amp;nbsp;&amp;nbsp; (numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above message, the corresponding codes in my program is "dwn=choose(wn=.,0,wn);" where wn is a 624*624 matrix.&lt;/P&gt;&lt;P&gt;Well, the point is that I did the same simulations (same codes on same server, I promise) last Nov, but everything was fine without memory problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the information about the sas version and the linux system I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last Nov. :&lt;/P&gt;&lt;P&gt;NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) &lt;/P&gt;&lt;P&gt;NOTE: This session is executing on the &lt;SPAN style="color: #ff0000;"&gt;Linux 2.6.18-238.9.1.el5 (LIN X64) platform&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recently:&lt;/P&gt;&lt;P&gt;NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) &lt;/P&gt;&lt;P&gt;NOTE: This session is executing on the &lt;SPAN style="color: #ff0000;"&gt;Linux 2.6.18-274.7.1.el5 (LIN X64) platform&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the 'out of memory' issue really result from the system difference?&lt;/P&gt;&lt;P&gt;Any clue?&lt;/P&gt;&lt;P&gt;I have been struggling with this problem for a while.&lt;/P&gt;&lt;P&gt;I would appreciate anyone who can help out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vivian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 11:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21980#M83</guid>
      <dc:creator>Vivian</dc:creator>
      <dc:date>2012-03-05T11:50:28Z</dc:date>
    </item>
    <item>
      <title>SAS IML Memory Issue</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21981#M84</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange. SAS didn't change, but you are getting different behavior. I have no idea what has changed on your system, &lt;/P&gt;&lt;P&gt;but remember that memory is shared among all applications. If you have a big PDF file open, an email program running, or other applications, those are all using memory, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, maybe I can solve the immediate problem of getting your program to run. Instead of &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dwn=choose(wn=.,0,wn);&lt;/P&gt;&lt;P&gt;try this: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dwn = wn;&amp;nbsp; /* copy wn */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; idx = loc(dwn=.); /* find missing */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if ncol(idx)&amp;gt;0 then dwn[idx]=0; /* replace with zeros */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code can be even more memory-efficient if you are willing to overwrite the original copy of wn: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; idx = loc(wn=.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if ncol(idx)&amp;gt;0 then wn[idx]=0; /* overwrite wn */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, this might just move the out-of-memory error to another line of the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 13:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21981#M84</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-03-05T13:40:10Z</dc:date>
    </item>
    <item>
      <title>SAS IML Memory Issue</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21982#M85</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your prompt reply.&lt;/P&gt;&lt;P&gt;As I have used SAS for many years, it is also my first time to have such problem.&lt;/P&gt;&lt;P&gt;I also have no idea what has been chenged in our system.&lt;/P&gt;&lt;P&gt;The staff at our school computer center in fact could not figure out what happened. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the out-of-memory problem, I did ever edited the codes and unfortunately, like you exppected, it moved the error to another line of the problem.&lt;/P&gt;&lt;P&gt;I even tried to release some memory and still, it didn't work.&lt;/P&gt;&lt;P&gt;That is why I have been struggling for such a log time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another interesting thing is that I submitted the same SAS program on a computer with window 7. &lt;/P&gt;&lt;P&gt;Everything works well without memory problem, even with the function CHOOSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, no solution, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I still appreciate your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, by the way, as I have read through your book and started using IML Studio for a while, I have a question in mind.&lt;/P&gt;&lt;P&gt;Can IML Studio work together with some macro codes, like we ususally do in regular IML (PROC IML)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;&lt;P&gt;Vivian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 15:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21982#M85</guid>
      <dc:creator>Vivian</dc:creator>
      <dc:date>2012-03-05T15:03:34Z</dc:date>
    </item>
    <item>
      <title>SAS IML Memory Issue</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21983#M86</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can contact technical support to see if they have any advice on the out-of-memory situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding macros, SAS/IML Studio programs are not parsed by the macro facility, so it doesn't support macros in the usual way. However, you can &lt;/P&gt;&lt;P&gt;1) call macros within a SUBMIT/ENDSUBMIT block. These are executed in the SAS environment.&lt;/P&gt;&lt;P&gt;2) Use the SYMGET and SYMPUT family of functions to get or set macro variables from within a SAS/IML Studio program. For example, the following statements set a macro variable (The &lt;A href="mailto:'@'"&gt;'@'&lt;/A&gt; operator is shorthand for 'submit this single SAS statement.'), then reads in the macro and assigns it to an IML variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@%let g=5; /* submit global stmt */&lt;/P&gt;&lt;P&gt;five = symgetn("g");&lt;/P&gt;&lt;P&gt;print five;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See p. 99 of my book for more examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 15:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-IML-Memory-Issue/m-p/21983#M86</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-03-05T15:33:22Z</dc:date>
    </item>
  </channel>
</rss>

