<?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: Subtracting Two Arrays in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234273#M54909</link>
    <description>&lt;P&gt;Thanks guys!&amp;nbsp; I got that to work with a couple of tweeks...&amp;nbsp; I appreciate it!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2015 19:41:21 GMT</pubDate>
    <dc:creator>BU2B</dc:creator>
    <dc:date>2015-11-11T19:41:21Z</dc:date>
    <item>
      <title>Subtracting Two Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234245#M54904</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to subtract the values in two (identical) datasets using arrays.&amp;nbsp; Do I need to create a function, or can I do it with something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data array1;&lt;BR /&gt;&amp;nbsp;set etrm_crep_va4;&lt;BR /&gt;&amp;nbsp;array array1 {24} HR0-HR23;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data array2;&lt;BR /&gt;&amp;nbsp;set etrm_crep_va4_i;&lt;BR /&gt;&amp;nbsp;array array2 {24} HR0-HR23;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Calculate the VA4 incremental difference*/&lt;/P&gt;
&lt;P&gt;data etrm_crep_va4_inc;&lt;BR /&gt;array array1 {24} HR0-HR23;&lt;BR /&gt;array array2 {24} HR0-HR23;&lt;BR /&gt;&amp;nbsp;do i = 1 to 24;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;array1{i}-array2{i};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;output;&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234245#M54904</guid>
      <dc:creator>BU2B</dc:creator>
      <dc:date>2015-11-11T17:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting Two Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234247#M54906</link>
      <description>&lt;P&gt;Arrays never refer to two observations at the same time.&amp;nbsp; By definition, an array only refers to values within a single observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your problem may still be possible to solve, but it will take more programming than that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have just one observation in each data set?&amp;nbsp; Otherwise, how do you know how to match the observations from one data set to the other?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234247#M54906</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-11T17:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting Two Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234248#M54907</link>
      <description>&lt;P&gt;You could try this way.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; merge etrm_crep_va4&amp;nbsp; etrm_crep_va4_i(rename=(HR0-HR23=_HR0-_HR23));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array array1 {24} HR0-HR23;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array array2 {24} _HR0-_HR23;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array array3 {24} Var0-Var23;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do i = 1 to 24;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array3{i}=array1{i}-array2{i};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 17:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234248#M54907</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-11T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting Two Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234273#M54909</link>
      <description>&lt;P&gt;Thanks guys!&amp;nbsp; I got that to work with a couple of tweeks...&amp;nbsp; I appreciate it!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 19:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subtracting-Two-Arrays/m-p/234273#M54909</guid>
      <dc:creator>BU2B</dc:creator>
      <dc:date>2015-11-11T19:41:21Z</dc:date>
    </item>
  </channel>
</rss>

