<?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: Two dimentional arrays and use them in calculation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295794#M61852</link>
    <description>&lt;P&gt;Thanks It worked like magic&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 12:20:01 GMT</pubDate>
    <dc:creator>dpa</dc:creator>
    <dc:date>2016-09-01T12:20:01Z</dc:date>
    <item>
      <title>Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295735#M61833</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; temp speed;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;2 25&lt;/P&gt;&lt;P&gt;6 30&lt;/P&gt;&lt;P&gt;4 29&lt;/P&gt;&lt;P&gt;5 38&lt;/P&gt;&lt;P&gt;8 20&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;array&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; temp_array(&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;) temp speed ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;m=(temp_array{&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;}-temp_array{&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;}/temp_array{&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;}-temp_array{&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;});&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So want to create array or any other way I can refrence the value of temp and speed in my formula?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295735#M61833</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T09:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295740#M61834</link>
      <description>&lt;P&gt;Are the results from that what you expect?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS arrays are shortcuts to variables - in the same row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your array above does not take on the values in your dataset. I would expect all results to be missing...&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295740#M61834</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-01T09:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295751#M61839</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so basically I want to create array on variable values and then use that array as refence in calculation. So I can do create macro variable for each value in temp and speed variable then how to use that in array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295751#M61839</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T09:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295752#M61840</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;so basically I want to create array on variable values and then use that array as refence in calculation. So I can do create macro variable for each value in temp and speed variable then how to use that in array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295752#M61840</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T09:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295753#M61841</link>
      <description>&lt;P&gt;You have to load the data into the array "manually", see example code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  set test end=last;
  array temp_array(5,2) _temporary_;
  temp_array{_n_, 1} = temp;
  temp_array{_n_, 2} = speed;

  if last = 1 then do;
    m=(temp_array{1,1}-temp_array{2,2}/temp_array{2,1}-temp_array{3,2});
    putlog m=;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The example uses the _TEMPORARY_ keyword, so no variables are created in the Program Data Vector (PDV), also all the values are retained.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once the array is loaded, you can use the expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295753#M61841</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-09-01T09:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295756#M61842</link>
      <description>&lt;P&gt;What are you trying to do overall? You can use your method but it may not be efficient given how SAS processes information and your original question seemed to relate to efficiency.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to work with data as you're stating consider using SAS IML.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295756#M61842</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-01T09:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295762#M61846</link>
      <description>&lt;P&gt;Hi Bruno one thing why you using the end=last and if process I didn't understand and if you do calculation it does not give&amp;nbsp;right answer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 09:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295762#M61846</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T09:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295763#M61847</link>
      <description>&lt;P&gt;exactly I am trying to find alternamte to proc IML&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;iml&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;use&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;read&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; all;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;x=temp||speed;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;m=(x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;]-x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;])/(x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;]-x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;]);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;l=x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;]*m-x[&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;];&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; line &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;{m l};&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;append&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;close&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; line;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;but I want to do without IML.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 10:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295763#M61847</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T10:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295773#M61848</link>
      <description>&lt;PRE&gt;
No need for ARRAY.
By the way, your IML doesn't look right .


data test;
input temp speed;
datalines;
2 25
6 30
4 29
5 38
8 20
;
run;
data want;
 set test;
 m=dif(speed)/dif(temp);
 l=lag(temp)*m-lag(speed);
run;


&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 11:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295773#M61848</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-01T11:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295777#M61849</link>
      <description>&lt;P&gt;The END = LAST sets a flag that tells you when the last oberservation has been read;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The expression for M was doifferent in your DATA Step as compared to the one you are using in IML&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the new code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  set test end=last;
  array temp_array(5,2) _temporary_;
  temp_array{_n_, 1} = temp;
  temp_array{_n_, 2} = speed;

  /*
   * if all the data has been read, do the caculation
   */
  if last = 1 then do;
    m = (temp_array{2,2} - temp_array{1,2}) / (temp_array{2,1} - temp_array{1,1});
    l = temp_array{1,1} * m - temp_array{1,2};
    putlog m= l=;
    output;
  end;
  keep m l;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please note that DATA Step arrays are not a replacement for the functionality you have in IML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 11:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295777#M61849</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-09-01T11:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295794#M61852</link>
      <description>&lt;P&gt;Thanks It worked like magic&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295794#M61852</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T12:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295795#M61853</link>
      <description>&lt;P&gt;Thanks Bruno&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It did work and take on board your advise and learn more about array&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295795#M61853</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T12:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295867#M61880</link>
      <description>&lt;P&gt;HI Ksharp please can you tell me what is wrong with Proc IML just for my understanding. lag and dif only select one previous value what if I want to cahange the value pick up diffrent one.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 14:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295867#M61880</guid>
      <dc:creator>dpa</dc:creator>
      <dc:date>2016-09-01T14:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295894#M61888</link>
      <description>&lt;P&gt;Please look at the documentation for the Lag and Dif functions. You can reference Lag1 (default when coding as Lag) Lag2 = second previous, Lag3 = third previous. You therefore have MANY previous records you can address and similar for DIF.&lt;/P&gt;
&lt;P&gt;Lag can impact memory resources as copies of each value are kept. Lag100 requires keeping track of 100 values so memory is 100*length of the variable.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 15:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295894#M61888</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-01T15:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295936#M61910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If you don't have IML


HAVE

libname sd1 "d:/sd1";
data sd1.have;
input temp speed;
cards4;
2 25
6 30
4 29
5 38
8 20
;;;;
run;

WANT

[1,1]-[2,2]/[2,1]-[3,2]);

-32 = 2 - 30/6 - 29

%utl_submit_r64('
library(haven);
temp_array&amp;lt;-as.matrix(read_sas("d:/sd1/have.sas7bdat"));
temp_array;
m&amp;lt;-(temp_array[1,1]-temp_array[2,2]/temp_array[2,1]-temp_array[3,2]);
m;
');


&amp;gt; library(haven);temp_array&amp;lt;-as.matrix(read_sas("d:/sd1/have.sas7bdat"));
temp_array;m&amp;lt;-(temp_array[1,1]-temp_array[2,2]/temp_array[2,1]-temp_array[3,2]);m;

     TEMP SPEED
[1,]    2    25
[2,]    6    30
[3,]    4    29
[4,]    5    38
[5,]    8    20

TEMP
 -32
&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 16:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/295936#M61910</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-09-01T16:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Two dimentional arrays and use them in calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/296039#M61944</link>
      <description>&lt;PRE&gt;
Your IML code is not vector operator, so you need a LOOP , but you didn't.

It is scalar operator, so is not good for IML , it is good for Data Step.


&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 03:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Two-dimentional-arrays-and-use-them-in-calculation/m-p/296039#M61944</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-02T03:49:58Z</dc:date>
    </item>
  </channel>
</rss>

