<?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: SAS EG calculated column using lagged variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-calculated-column-using-lagged-variable/m-p/407383#M99263</link>
    <description>&lt;P&gt;Well...the error is correct, SQL doesn't have the concept of row order, it operates on the entire data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you trying to do here? I suspect BY group processing within a data set is more efficient.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 17:38:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-25T17:38:29Z</dc:date>
    <item>
      <title>SAS EG calculated column using lagged variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-calculated-column-using-lagged-variable/m-p/407380#M99262</link>
      <description>&lt;P&gt;I am using SAS EG and attempting to use the lag function however it is telling me&lt;/P&gt;&lt;P&gt;"ERROR: The LAG function is not supported in PROC SQL, it is only valid within the DATA step." I have sorted the data by the fields I am trying to lag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is within my dataset, I want to create a dummy variable for if a condition is met. Example, if&amp;nbsp;track = last line track AND driver = last line driver AND date equals last line date THEN indicate using a 1, else use a zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do all of this using the query builder and creating calculated columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 17:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-EG-calculated-column-using-lagged-variable/m-p/407380#M99262</guid>
      <dc:creator>Amber_Nicole94</dc:creator>
      <dc:date>2017-10-25T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG calculated column using lagged variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-calculated-column-using-lagged-variable/m-p/407383#M99263</link>
      <description>&lt;P&gt;Well...the error is correct, SQL doesn't have the concept of row order, it operates on the entire data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you trying to do here? I suspect BY group processing within a data set is more efficient.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 17:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-EG-calculated-column-using-lagged-variable/m-p/407383#M99263</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-25T17:38:29Z</dc:date>
    </item>
  </channel>
</rss>

