<?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: Splitting a matrix in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426389#M3977</link>
    <description>&lt;P&gt;I think you are nearly running out of memory when you create y`, and then when you try to create c that is the final straw.&amp;nbsp; Since c needs less space than y`, I think it should work if you avoid forming y`,&amp;nbsp;&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use one;
read all var _CHAR_ into y[colname=cNames];
close one;
c = length(y);
print cnames;
k = t( cnames//char(c[&amp;lt;&amp;gt;,]) );
print k;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Jan 2018 12:00:06 GMT</pubDate>
    <dc:creator>IanWakeling</dc:creator>
    <dc:date>2018-01-10T12:00:06Z</dc:date>
    <item>
      <title>Splitting a matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426365#M3975</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below code is not executing successfully as the matrix size is large.&amp;nbsp;The program is ending up with the below error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: (execution) Unable to allocate sufficient memory.&lt;/P&gt;&lt;P&gt;operation : LENGTH at line 1395 column 11&lt;BR /&gt;operands : _TEM1001&lt;BR /&gt;_TEM1001 33 rows 400000 cols (character, size 80)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to find and split the matrix based on the size?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dm "output" clear;&lt;BR /&gt;data one;&lt;BR /&gt;array cha{*} $18. c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33;&lt;BR /&gt;do j = 1 to 400000;&lt;BR /&gt;seed = 100;&lt;BR /&gt;do i = 1 to hbound(cha);&lt;BR /&gt;rannum = ranpoi(seed,50);&lt;BR /&gt;if rannum = 0 then rannum = 1;&lt;BR /&gt;cha{i} = repeat("a",rannum);&lt;BR /&gt;end;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use one;&lt;BR /&gt;read all var _CHAR_ into y[colname=cNames];&lt;BR /&gt;close one;&lt;BR /&gt;c = length(y`);&lt;BR /&gt;k = cnames`||char(c[,&amp;lt;&amp;gt;]);&lt;BR /&gt;print k;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Venkat.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 11:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426365#M3975</guid>
      <dc:creator>Venkibhu1</dc:creator>
      <dc:date>2018-01-10T11:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426383#M3976</link>
      <description>&lt;P&gt;I'm on my way out the door, but look at the following links for dealing with big matrices:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/04/28/how-much-ram-do-i-need-to-store-that-matrix.html" target="_self" rel="nofollow noopener noreferrer"&gt;&amp;nbsp;How much RAM do I need to store that matrix?&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/07/31/large-matrices.html" target="_self" rel="nofollow noopener noreferrer"&gt;&amp;nbsp;Large matrices in SAS/IML 14.1&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2013/01/21/reading-big-data.html" target="_self" rel="nofollow noopener noreferrer"&gt;Reading big data in the SAS/IML language&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 11:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426383#M3976</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-10T11:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426389#M3977</link>
      <description>&lt;P&gt;I think you are nearly running out of memory when you create y`, and then when you try to create c that is the final straw.&amp;nbsp; Since c needs less space than y`, I think it should work if you avoid forming y`,&amp;nbsp;&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use one;
read all var _CHAR_ into y[colname=cNames];
close one;
c = length(y);
print cnames;
k = t( cnames//char(c[&amp;lt;&amp;gt;,]) );
print k;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 12:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426389#M3977</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2018-01-10T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a matrix</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426441#M3978</link>
      <description>&lt;P&gt;The size of y will depend on the length of the character variables in the data set.&amp;nbsp; A variable with length=256 takes twice as much RAM as one that has length=128.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at the MEMSIZE option (second link) to allocate more memory. Since you are computing a maximum, you can also break the data into chunks, as shown in the third link. To build on Ian's program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc iml;
use one nObs N;
chunkSize = N/ 10;
max = .;
do data;
   read next (chunkSize) var _CHAR_ into y[colname=cNames];
   c = length(y);
   if max=. then max = c[&amp;lt;&amp;gt;, ];
   else max = (max // c[&amp;lt;&amp;gt;, ])[&amp;lt;&amp;gt;, ];
end;
close one;

k = t( cnames// char(max) );
print k;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Splitting-a-matrix/m-p/426441#M3978</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-10T13:46:25Z</dc:date>
    </item>
  </channel>
</rss>

