<?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: lag function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186207#M47300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi data_null,&lt;/P&gt;&lt;P&gt;Thank you so much for your quick response!&lt;/P&gt;&lt;P&gt;I came up with my revised code, but this only works if I know how many consecutive rows will be missing in advance.&lt;/P&gt;&lt;P&gt;Your code is much better!! Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data no_missing(drop=i);&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;array ticker(*)A--C;&lt;/P&gt;&lt;P&gt;do i=1 to dim(ticker);&lt;/P&gt;&lt;P&gt;lag=lag(ticker{i});&lt;/P&gt;&lt;P&gt;lag=lag2(ticker{i});&lt;/P&gt;&lt;P&gt;if ticker{i}=. then ticker{i}=coalesce(lag,lag2);&lt;/P&gt;&lt;P&gt;else if ticker{i}=ticker{i};&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 16:16:10 GMT</pubDate>
    <dc:creator>blue_lion</dc:creator>
    <dc:date>2015-02-27T16:16:10Z</dc:date>
    <item>
      <title>lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186204#M47297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have a test data with missing values and I want to fill the table by taking previous month's value&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test data&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" summary="Page Layout" width="158"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="19" width="98"&gt;month&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="16"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="15"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="29"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="19" style="border-top: none;" width="98"&gt;Jan&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="16"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="15"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="29"&gt;3.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="19" style="border-top: none;" width="98"&gt;Feb&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="16"&gt;4&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="15"&gt;.&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="29"&gt;56&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="19" style="border-top: none;" width="98"&gt;Mar&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="16"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;" width="15"&gt;.&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="29"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="19" style="border-top: none;" width="98"&gt;Apr&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="16"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="15"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="29"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="20" style="border-top: none;" width="98"&gt;May&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;" width="16"&gt;.&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;" width="15"&gt;6&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top: none; border-left: none;" width="29"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data I want to have&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 158px;" summary="Page Layout"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="19" width="98"&gt;month&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="16"&gt;A&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="15"&gt;B&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none;" width="29"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" style="border-top: none;" width="98"&gt;Jan&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="16"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="15"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;" width="29"&gt;3.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" style="border-top: none;" width="98"&gt;Feb&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="16"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl75" style="border-top: none; border-left: none;" width="15"&gt;&lt;STRONG style="color: #ff0000;"&gt;2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;" width="29"&gt;56&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" style="border-top: none;" width="98"&gt;Mar&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="16"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl75" style="border-top: none; border-left: none;" width="15"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl76" style="border-top: none; border-left: none;" width="29"&gt;&lt;STRONG style="color: #ff0000;"&gt;56&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="19" style="border-top: none;" width="98"&gt;Apr&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="16"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="15"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;" width="29"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl71" height="20" style="border-top: none;" width="98"&gt;May&lt;/TD&gt;&lt;TD align="right" class="xl74" style="border-top: none; border-left: none;" width="16"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top: none; border-left: none;" width="15"&gt;6&lt;/TD&gt;&lt;TD align="right" class="xl73" style="border-top: none; border-left: none;" width="29"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code I wrote, but it gives me the exact original table with missing data and I do not get an error message in the log.&lt;/P&gt;&lt;P&gt;I wonder why the lagged values are not applied according to my if statement logic..&lt;/P&gt;&lt;P&gt;I appreciate if someone could help me shed a light on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input month $ A B C;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;Jan 1 2 3.3&lt;/P&gt;&lt;P&gt;Feb 4 . 56&lt;/P&gt;&lt;P&gt;Mar 3 . .&lt;/P&gt;&lt;P&gt;Apr 5 3 4&lt;/P&gt;&lt;P&gt;May . 6 2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data no_missing(drop=i);&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;array ticker(*)A--C;&lt;/P&gt;&lt;P&gt;do i=1 to dim(ticker);&lt;/P&gt;&lt;P&gt;if ticker{i}=. then ticker{i}=lag(ticker{i});&lt;/P&gt;&lt;P&gt;else ticker{i}=ticker{i};&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 15:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186204#M47297</guid>
      <dc:creator>blue_lion</dc:creator>
      <dc:date>2015-02-27T15:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186205#M47298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just recalled lag function in a conditional statement always returns missing value...&lt;/P&gt;&lt;P&gt;That's why I was getting the identical original table after running code..&lt;/P&gt;&lt;P&gt;but I appreciate if anyone can let me know how to code this without using lag function..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186205#M47298</guid>
      <dc:creator>blue_lion</dc:creator>
      <dc:date>2015-02-27T16:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186206#M47299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LAG it not the proper tool for LOCF.&amp;nbsp; I like the UPDATE trick for your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; abc;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; month $ A&amp;nbsp; B&amp;nbsp; C;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;Jan&amp;nbsp;&amp;nbsp; 1&amp;nbsp; 2&amp;nbsp; 3.3&lt;BR /&gt;Feb&amp;nbsp;&amp;nbsp; 4&amp;nbsp; .&amp;nbsp; 56&lt;BR /&gt;Mar&amp;nbsp;&amp;nbsp; 3&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;Apr&amp;nbsp;&amp;nbsp; 5&amp;nbsp; 3&amp;nbsp; 4&lt;BR /&gt;May&amp;nbsp;&amp;nbsp; .&amp;nbsp; 6&amp;nbsp; 2&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; abcV / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=abcv;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dummy &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; abc;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; locf;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; abcv(obs=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;) abcv;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dummy;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dummy;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;IMG alt="2-27-2015 10-07-39 AM.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/9380_2-27-2015 10-07-39 AM.png" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186206#M47299</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-02-27T16:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186207#M47300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi data_null,&lt;/P&gt;&lt;P&gt;Thank you so much for your quick response!&lt;/P&gt;&lt;P&gt;I came up with my revised code, but this only works if I know how many consecutive rows will be missing in advance.&lt;/P&gt;&lt;P&gt;Your code is much better!! Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data no_missing(drop=i);&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;array ticker(*)A--C;&lt;/P&gt;&lt;P&gt;do i=1 to dim(ticker);&lt;/P&gt;&lt;P&gt;lag=lag(ticker{i});&lt;/P&gt;&lt;P&gt;lag=lag2(ticker{i});&lt;/P&gt;&lt;P&gt;if ticker{i}=. then ticker{i}=coalesce(lag,lag2);&lt;/P&gt;&lt;P&gt;else if ticker{i}=ticker{i};&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186207#M47300</guid>
      <dc:creator>blue_lion</dc:creator>
      <dc:date>2015-02-27T16:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186208#M47301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like the VIEW! Learn some!&lt;/P&gt;&lt;P&gt;I used to hate adding another dummy variable in this case, but not anymore with the view. Thanks for sharing, John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186208#M47301</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-27T16:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186209#M47302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quote: "I just recalled lag function in a conditional statement &lt;SPAN style="color: #575757;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;always&lt;/STRONG&gt;&lt;/SPAN&gt; returns missing value.."&lt;/P&gt;&lt;P&gt;Wrong. The LAG() will return next value in the queue, missing or non-missing, conditional or non-conditional. Please read the manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like you, I like the options from data _null_ very much. Here is another alternative that maybe closer to what you are familiar with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; month $ A B C;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Jan 1 2 3.3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Feb 4 . 56&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Mar 3 . .&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Apr 5 3 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;May . 6 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ticker(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;) a--c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _ticker(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;_temporary_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ticker(i)=coalesce(ticker(i), _ticker(i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ticker(i)=_ticker(i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186209#M47302</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-27T16:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186210#M47303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hai.Kuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response and pointing this out!&lt;/P&gt;&lt;P&gt;In below doc, I read "Since LAG is called in conditional code, the value it returned is not the value from the previous observation, but is the value of its previous execution."&lt;/P&gt;&lt;P&gt;I also read "However, when it is executed conditionally, the LAG function only retrieves values from observations for which the condition is satisfied."&lt;/P&gt;&lt;P&gt;If you have any other good article on this topic, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings09/055-2009.pdf" style="text-decoration: underline; font-size: 13.3333330154419px;" title="http://support.sas.com/resources/papers/proceedings09/055-2009.pdf"&gt;http://support.sas.com/resources/papers/proceedings09/055-2009.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 15:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186210#M47303</guid>
      <dc:creator>blue_lion</dc:creator>
      <dc:date>2015-02-28T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186211#M47304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think both of those statement are saying essentially the same thing. I think it is best to leave the word observation(s) out of the conversation all together. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LAG function retrieves the value from the last time it was executed.&amp;nbsp; Or in the case of LAGn the nth time it was executed.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 16:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186211#M47304</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-02-28T16:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186212#M47305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know it is confusing, and trust me, I have been there and stuck there for a not-short amount of time. SAS could do better to help users on this matter by 1. Changing the function name from Lag() to Queue() or something.&lt;/P&gt;&lt;P&gt;2. Doing better explanation job in their Docs, at least for the perspective of new users.&lt;/P&gt;&lt;P&gt;I completely agree what Data _null_ has just said in his post, here I will give you a short example in a hope to help you understand this better:&lt;/P&gt;&lt;P&gt;Here is the code, very simple, only focusing on the situation of LAG1, while LAGn() is pretty much the same concept.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; lag_test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sashelp.class(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;obs&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=Name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Uncon_queue=lag(name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; mod(_n_,&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;)=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Con_queue=lag(name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Here is the results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;IMG __jive_id="9396" alt="lag.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/9396_lag.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Explanation:&lt;/P&gt;&lt;P&gt;First, I want you to picture a queue, where &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() Push value&amp;nbsp; IN and Pull value OUT, I don't know where it sits, but I suspect it is somewhere in the memory, and its size will be limited by that factor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Second, remember that when &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, it will Pull out the last (most recent) in the queue , and Push in another one (the one in PDV) .(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;if LAG2(), it will pull out the Second Last in the queue, if LAG3(), it will pull the Third Last in the queue, so on so forth. But in term of Push-in, they all behave the same.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For the Uncon_queue,&lt;/P&gt;&lt;P&gt;_n_=1, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, since this is the first time it executed, there is no values in the queue. So Pull_out(output)=MISSING, Push_in=Alfred;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_n_=2, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, Pull_out(output)=Alfred, Push_in=Alice&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=3, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, Pull_out(output)=Alice, Push_in=Barbara&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=4, so on so forth.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;So the content of this queue is: everyone from Alfred to James, it is consistent with a picture of 'lagging' observations. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Con_queue, very SAME thing happens, keep in mind &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() only executed when _n_ is a even number.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_n_=1, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() NOT executed, so output=missing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=2, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, since this is the first time it executed, there is no values in the queue. So Pull_out(output)=MISSING, Push_in=Alice, the current on in PDV.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=3, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() NOT executed, so output=missing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=4, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, Pull_out(output)=Alice, the last in Queue, Push_in=Carol, the current one in PDV&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=5, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() NOT executed, so output=missing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_n_=6, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAG() executed, Pull_out(output)=Carol, the last in Queue, Push_in=James, the current one in PDV&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;So the content of this queue is: Alice, Carol, James, where their _n_ is a even number, Obviously it is NOT consistent with &lt;SPAN style="font-size: 13.3333330154419px;"&gt;picture of 'lagging' observations.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But if you take this "Queue" concept into play, LAG() is predictable and consistent, like I said before, whenever it executes, it dumps in the current one in the PDV, at the same time, pull the last one in the queue out, missing or non-missing, conditional or non-conditional.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the real life, to make new user life easier, they are often taught not to use LAG() conditionally, because unconditionally using LAG() will be consistent with the layman concept of LAG, that is all of the obs will be put into the queue, one after another, nicely. And fortunately, most of the scenarios does not require to LAG under any condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But if you do have to use it conditionally, picture it as being pulling the last one from a queue, which is entirely different from pulling the previous observation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;HTH,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 22:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186212#M47305</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-28T22:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: lag function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186213#M47306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hai.Kuo and data_null_,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your response!&lt;/P&gt;&lt;P&gt;I am at awe how helpful and knowledgeable you are and I love SAS community for this precise reason!!&lt;/P&gt;&lt;P&gt;I hope you are having great weekend and thanks again!! &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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2015 12:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/lag-function/m-p/186213#M47306</guid>
      <dc:creator>blue_lion</dc:creator>
      <dc:date>2015-03-01T12:52:27Z</dc:date>
    </item>
  </channel>
</rss>

