<?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: non-consecutive/ consecutive dates? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715655#M221071</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set x;
by patid;
flag = (not first.patid and date ne lag(date) + 1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 31 Jan 2021 19:50:21 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-01-31T19:50:21Z</dc:date>
    <item>
      <title>non-consecutive/ consecutive dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715645#M221062</link>
      <description>&lt;P&gt;How to print non-consecutive / consecutive dates from given set of dates?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data x;
Input patid date mmddyy10.;
Datalines;
1001 02/01/10
1001 02/02/10
1001 02/03/10
1002 02/01/10
1002 02/03/10
1002 02/05/10
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can anyone explain the detailed logic step by step?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 18:25:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715645#M221062</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2021-01-31T18:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: non-consecutive/ consecutive dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715646#M221063</link>
      <description>What is your desired resultat here?</description>
      <pubDate>Sun, 31 Jan 2021 18:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715646#M221063</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-31T18:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: non-consecutive/ consecutive dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715655#M221071</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set x;
by patid;
flag = (not first.patid and date ne lag(date) + 1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 31 Jan 2021 19:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715655#M221071</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-01-31T19:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: non-consecutive/ consecutive dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715670#M221084</link>
      <description>&lt;P&gt;This might be a good situation to use the DIF function, where&amp;nbsp; dif(x) is equivalent to x - lag(x):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by patid;
  if first.patid=0 and dif(date)=1 then consecutive='Y';
  else consecutive='N';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 21:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/non-consecutive-consecutive-dates/m-p/715670#M221084</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-01-31T21:38:09Z</dc:date>
    </item>
  </channel>
</rss>

