<?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: Pick up the date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250452#M47221</link>
    <description>Like in the in the row number 3 I need the date because previous SOR is 1. In the 10th row I need date because previous SOR is 1</description>
    <pubDate>Tue, 16 Feb 2016 21:44:53 GMT</pubDate>
    <dc:creator>umesh1</dc:creator>
    <dc:date>2016-02-16T21:44:53Z</dc:date>
    <item>
      <title>Pick up the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250446#M47219</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below data set and I would like to pick up the mth_end_dt when SOR&amp;nbsp;from 1 to any number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;informat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; MTH_END_DT &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; CLNT_NO MTH_END_DT SOR;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; MTH_END_DT &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;1 31-Mar-14 1&lt;/P&gt;&lt;P&gt;1 30-Apr-14 1&lt;/P&gt;&lt;P&gt;1 31-May-14 2&lt;/P&gt;&lt;P&gt;1 30-Jun-14 2&lt;/P&gt;&lt;P&gt;1 31-Jul-14 3&lt;/P&gt;&lt;P&gt;1 31-Aug-14 3&lt;/P&gt;&lt;P&gt;1 30-Sep-14 3&lt;/P&gt;&lt;P&gt;1 31-Oct-14 3&lt;/P&gt;&lt;P&gt;1 30-Nov-14 1&lt;/P&gt;&lt;P&gt;1 31-Dec-14 3&lt;/P&gt;&lt;P&gt;1 31-Jan-15 3&lt;/P&gt;&lt;P&gt;1 28-Feb-15 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Help me&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 21:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250446#M47219</guid>
      <dc:creator>umesh1</dc:creator>
      <dc:date>2016-02-16T21:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250449#M47220</link>
      <description>&lt;P&gt;Can you explian better what you want to do? Could you give example of your desired output?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 21:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250449#M47220</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-16T21:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250452#M47221</link>
      <description>Like in the in the row number 3 I need the date because previous SOR is 1. In the 10th row I need date because previous SOR is 1</description>
      <pubDate>Tue, 16 Feb 2016 21:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250452#M47221</guid>
      <dc:creator>umesh1</dc:creator>
      <dc:date>2016-02-16T21:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250453#M47222</link>
      <description>&lt;P&gt;maybe this what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
set test;
prev=lag(sor);
if prev=1 and sor ~=1;
drop prev;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Feb 2016 21:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250453#M47222</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-16T21:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250462#M47223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/72037"&gt;@umesh1﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your real data contain more than one client, you may want to amend the IF condition in&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49185"&gt;@mohamed_zaki﻿&lt;/a&gt;'s data step as shown below. Otherwise the first observation of a client might be selected because the previous client's last observation had SOR=1.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if prev=1 and sor ~=1 and clnt_no=lag(clnt_no);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, this modification would be redundant if the first observation of each client had SOR=1.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pick-up-the-date/m-p/250462#M47223</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-16T22:25:28Z</dc:date>
    </item>
  </channel>
</rss>

