<?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 MultiArray in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440101#M69185</link>
    <description>&lt;P&gt;Array multi{1:2, 2}(1,2);&lt;/P&gt;&lt;P&gt;Do i=1 to 2;&lt;/P&gt;&lt;P&gt;Do j=1 to 2;&lt;/P&gt;&lt;P&gt;Output=multi{I,j};&lt;/P&gt;&lt;P&gt;What is the corresponding values of i, j, and output.&lt;/P&gt;&lt;P&gt;Someone gives the answer: A 2*2 multi-array, only two initial values, so&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i&amp;nbsp; &amp;nbsp;j&amp;nbsp; output&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 1&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 2&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;1&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;2&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;Could anybody explain how to get this result?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 02:03:28 GMT</pubDate>
    <dc:creator>monicazhou2013</dc:creator>
    <dc:date>2018-02-26T02:03:28Z</dc:date>
    <item>
      <title>MultiArray</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440101#M69185</link>
      <description>&lt;P&gt;Array multi{1:2, 2}(1,2);&lt;/P&gt;&lt;P&gt;Do i=1 to 2;&lt;/P&gt;&lt;P&gt;Do j=1 to 2;&lt;/P&gt;&lt;P&gt;Output=multi{I,j};&lt;/P&gt;&lt;P&gt;What is the corresponding values of i, j, and output.&lt;/P&gt;&lt;P&gt;Someone gives the answer: A 2*2 multi-array, only two initial values, so&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i&amp;nbsp; &amp;nbsp;j&amp;nbsp; output&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 1&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 2&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;1&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;2&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;Could anybody explain how to get this result?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 02:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440101#M69185</guid>
      <dc:creator>monicazhou2013</dc:creator>
      <dc:date>2018-02-26T02:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: MultiArray</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440106#M69186</link>
      <description>&lt;P&gt;"Someone" gave you the correct answer.&amp;nbsp; But there's a lot to explain.&amp;nbsp; Why don't you begin by explaining the parts of the ARRAY statement that you already understand.&amp;nbsp; Then we can fill in the remainder without having to explain things that you already know.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 03:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440106#M69186</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-26T03:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: MultiArray</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440113#M69188</link>
      <description>&lt;P&gt;Multi-dimensional arrays are stored in row-major order.&amp;nbsp; I.e all the elements of the first row precede the 2nd row, which precedes the 3rd row, etc.&amp;nbsp; And the first array index is the row index, the second is the column index.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your&amp;nbsp; statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; array{1:2,2}&lt;/P&gt;
&lt;P&gt;is the same as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; array{2,2};&lt;/P&gt;
&lt;P&gt;which is 2 rows of 2-elements each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2 initial values (1,2) are assigned to the first two elements of X, translating to elements&amp;nbsp; {1,1} and {1,2}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run this program you will print out the memory addresses of each element, confirming the row-major order of array storage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  array x{2,2} (1,2);
  add1_1=addrlong(x{1,1});
  add1_2=addrlong(x{1,2});
  add2_1=addrlong(x{2,1});
  add2_2=addrlong(x{2,2});
  put (add:) (=$hex16. /);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the addresses are "little-endian", i.e. the least significant byte (i.e. the least significant pair of hexadecimal digits) is the leftmost.&amp;nbsp; The addresses in my machine came out as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;9    data _null_;
10     array x{2,2} (1,2);
WARNING: Partial value initialization of the array x.
11     add1_1=addrlong(x{1,1});
12     add1_2=addrlong(x{1,2});
13     add2_1=addrlong(x{2,1});
14     add2_2=addrlong(x{2,2});
15     put (add:) (=$hex16. /);
16   run;

add1_1=9010682A00000000
add1_2=9810682A00000000
add2_1=A010682A00000000
add2_2=A810682A00000000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 05:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MultiArray/m-p/440113#M69188</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-02-26T05:20:41Z</dc:date>
    </item>
  </channel>
</rss>

