<?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: Minusing first obs with another leaving first observation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48369#M13077</link>
    <description>A DATA step and investigate using the LAG function to use variable values from a previous observation.  Have a look at the SAS.COM support website and the SAS Language Guide discussion on the LAG function.  Also, there are also technical papers from prior conferences available on the website.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Fri, 19 Sep 2008 12:39:35 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2008-09-19T12:39:35Z</dc:date>
    <item>
      <title>Minusing first obs with another leaving first observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48367#M13075</link>
      <description>i have ao datasets i want to minus the first observation by another &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data x;&lt;BR /&gt;
input id sal;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2&lt;BR /&gt;
3 4&lt;BR /&gt;
5 6&lt;BR /&gt;
7 8&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i want like this id -sal by leaving the first observariopn  1-4,3-6,5-8 finally the output shd be like this.</description>
      <pubDate>Fri, 19 Sep 2008 08:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48367#M13075</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2008-09-19T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Minusing first obs with another leaving first observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48368#M13076</link>
      <description>You can use the lag function/&lt;BR /&gt;
If i take your example it may look like this:&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
set x;&lt;BR /&gt;
w=lag(id)-sal;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 19 Sep 2008 12:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48368#M13076</guid>
      <dc:creator>yonib</dc:creator>
      <dc:date>2008-09-19T12:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Minusing first obs with another leaving first observation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48369#M13077</link>
      <description>A DATA step and investigate using the LAG function to use variable values from a previous observation.  Have a look at the SAS.COM support website and the SAS Language Guide discussion on the LAG function.  Also, there are also technical papers from prior conferences available on the website.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 19 Sep 2008 12:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Minusing-first-obs-with-another-leaving-first-observation/m-p/48369#M13077</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-19T12:39:35Z</dc:date>
    </item>
  </channel>
</rss>

