<?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: Camparing two data fields in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35566#M4467</link>
    <description>Thanks Romakanta.</description>
    <pubDate>Tue, 05 Aug 2008 13:22:55 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-08-05T13:22:55Z</dc:date>
    <item>
      <title>Camparing two data fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35564#M4465</link>
      <description>I need help in SAS Enterprise Guide.  I have a table containing current and historical data.  The data is in the same column as such:&lt;BR /&gt;
&lt;BR /&gt;
date          name    value&lt;BR /&gt;
7/5            John      5&lt;BR /&gt;
current      John       10&lt;BR /&gt;
&lt;BR /&gt;
I need SAS to return the difference.  If there is no difference, then it won't return a value.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Thu, 31 Jul 2008 19:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35564#M4465</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-07-31T19:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Camparing two data fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35565#M4466</link>
      <description>Not very sure of what you exactly want but i think you can try using the first.variable_name, last.variable_name, and the lag function.&lt;BR /&gt;
&lt;BR /&gt;
data yourdata;&lt;BR /&gt;
by name date;&lt;BR /&gt;
if first.date &amp;lt;&amp;gt; last.date then;&lt;BR /&gt;
diff_date=date-lag(date);&lt;BR /&gt;
diff_value=date-lag(value);&lt;BR /&gt;
....&lt;BR /&gt;
....&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Romakanta</description>
      <pubDate>Mon, 04 Aug 2008 09:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35565#M4466</guid>
      <dc:creator>datalligence</dc:creator>
      <dc:date>2008-08-04T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Camparing two data fields</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35566#M4467</link>
      <description>Thanks Romakanta.</description>
      <pubDate>Tue, 05 Aug 2008 13:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Camparing-two-data-fields/m-p/35566#M4467</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-05T13:22:55Z</dc:date>
    </item>
  </channel>
</rss>

