<?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 Difference between two dates greater then 28 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Difference-between-two-dates-greater-then-28/m-p/155455#M40826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have dataset with three varaibles id startdate enddate. Dates are numerical sas formats.&lt;/P&gt;&lt;P&gt;I would like to pull out the records for id where the difference between the two succesive START dates is more then 28 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; STARTDATE ENDDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19583&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19604&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19589&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19609&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19610&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19628&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19638&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19480&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19520&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2014 12:20:44 GMT</pubDate>
    <dc:creator>rakeshvvv</dc:creator>
    <dc:date>2014-03-25T12:20:44Z</dc:date>
    <item>
      <title>Difference between two dates greater then 28</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difference-between-two-dates-greater-then-28/m-p/155455#M40826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have dataset with three varaibles id startdate enddate. Dates are numerical sas formats.&lt;/P&gt;&lt;P&gt;I would like to pull out the records for id where the difference between the two succesive START dates is more then 28 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; STARTDATE ENDDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19583&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19604&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19589&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19609&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19610&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19628&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19638&lt;/P&gt;&lt;P&gt;001&amp;nbsp;&amp;nbsp; 19480&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19520&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 12:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difference-between-two-dates-greater-then-28/m-p/155455#M40826</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2014-03-25T12:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates greater then 28</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Difference-between-two-dates-greater-then-28/m-p/155456#M40827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks like an appliaction for a dow loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (keep=id1 st1 enddate rename=(id1=id st1=startdate));&lt;/P&gt;&lt;P&gt;format id1 st1 enddate; /* just to keep the vars in order */&lt;/P&gt;&lt;P&gt;do until ((startdate - lastdate &amp;gt;= 28) or finish);&lt;/P&gt;&lt;P&gt;&amp;nbsp; lastdate = startdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have end=finish;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.id then lastdate = startdate;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;if startdate - lastdate &amp;gt;= 28&lt;/P&gt;&lt;P&gt;then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do until (lastdate = st1 and id = id1); /* read to the first record */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have (rename=(id=id1 startdate=st1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do until (startdate = st1 and id = id1); /* read to the second record */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have (rename=(id=id1 startdate=st1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&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>Tue, 25 Mar 2014 13:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Difference-between-two-dates-greater-then-28/m-p/155456#M40827</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-03-25T13:18:38Z</dc:date>
    </item>
  </channel>
</rss>

