<?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 How to mark more than three consecutive years having the same months? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798754#M314007</link>
    <description>&lt;P&gt;Hi, all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I always appreciate your expertise and help-out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without your help, I couldn't have survived up to this moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a panel data based on year-months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check and mark three or more consecutive years in which trades were made in the same months. So, I sorted my data by ID, CUSIP, MONTH, and YEAR.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, the data runs as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp;CUSIP&amp;nbsp; YEAR MONTH&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1995&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;50 381317 1993&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1994&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1996&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1997&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, based on this dataset, I am going to mark the identical months over equal to or more than three observations. But, at the same time, YEAR should be consecutive.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, my desired results are supposed to look like the following.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp;CUSIP&amp;nbsp; YEAR&amp;nbsp; MON&amp;nbsp; Mark&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1995&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;50 381317 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1996&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1997&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only the same months more than three obs. over consecutive years are marked 1, otherwise zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KS -,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 22:36:19 GMT</pubDate>
    <dc:creator>KS99</dc:creator>
    <dc:date>2022-02-25T22:36:19Z</dc:date>
    <item>
      <title>How to mark more than three consecutive years having the same months?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798754#M314007</link>
      <description>&lt;P&gt;Hi, all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I always appreciate your expertise and help-out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without your help, I couldn't have survived up to this moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a panel data based on year-months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check and mark three or more consecutive years in which trades were made in the same months. So, I sorted my data by ID, CUSIP, MONTH, and YEAR.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, the data runs as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp;CUSIP&amp;nbsp; YEAR MONTH&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;13 92939U 1995&amp;nbsp; &amp;nbsp; 11&lt;BR /&gt;50 381317 1993&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1994&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1996&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;50 381317 1997&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, based on this dataset, I am going to mark the identical months over equal to or more than three observations. But, at the same time, YEAR should be consecutive.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, my desired results are supposed to look like the following.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp;CUSIP&amp;nbsp; YEAR&amp;nbsp; MON&amp;nbsp; Mark&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1992&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;13 92939U 1995&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;50 381317 1993&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1994&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1996&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;50 381317 1997&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only the same months more than three obs. over consecutive years are marked 1, otherwise zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KS -,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 22:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798754#M314007</guid>
      <dc:creator>KS99</dc:creator>
      <dc:date>2022-02-25T22:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to mark more than three consecutive years having the same months?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798798#M314024</link>
      <description>&lt;P&gt;Use a double DOW loop.&lt;/P&gt;
&lt;P&gt;In the first loop count the length of the run.&lt;/P&gt;
&lt;P&gt;Then convert the count to your 0/1 binary flag.&lt;/P&gt;
&lt;P&gt;Then in the second loop re-read the data and write out all of the observations for this run.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input ID $ CUSIP $ YEAR MONTH ;
cards;
13 92939U 1992      2
13 92939U 1993      3
13 92939U 1992      4
13 92939U 1993      4
13 92939U 1994      4
13 92939U 1993      7
13 92939U 1994      7
13 92939U 1992      8
13 92939U 1993      8
13 92939U 1994      8
13 92939U 1993      9
13 92939U 1994      9
13 92939U 1992    10
13 92939U 1993    10
13 92939U 1994    10
13 92939U 1992    11
13 92939U 1993    11
13 92939U 1994    11
13 92939U 1995    11
50 381317 1993     2
50 381317 1994     2
50 381317 1996     2
50 381317 1997     2  
;

data want;
  do _n_=1 by 1 until (last.month);
    set have ;
    by id CUSIP month ;
  end;
  mark = _n_ &amp;gt;=3 ;
  do _n_=1 to _n_ ;
    set have;
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs    ID    CUSIP     YEAR    MONTH     mark

  1    13    92939U    1992       2        0
  2    13    92939U    1993       3        0
  3    13    92939U    1992       4        1
  4    13    92939U    1993       4        1
  5    13    92939U    1994       4        1
  6    13    92939U    1993       7        0
  7    13    92939U    1994       7        0
  8    13    92939U    1992       8        1
  9    13    92939U    1993       8        1
 10    13    92939U    1994       8        1
 11    13    92939U    1993       9        0
 12    13    92939U    1994       9        0
 13    13    92939U    1992      10        1
 14    13    92939U    1993      10        1
 15    13    92939U    1994      10        1
 16    13    92939U    1992      11        1
 17    13    92939U    1993      11        1
 18    13    92939U    1994      11        1
 19    13    92939U    1995      11        1
 20    50    381317    1993       2        1
 21    50    381317    1994       2        1
 22    50    381317    1996       2        1
 23    50    381317    1997       2        1
&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Feb 2022 04:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798798#M314024</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-26T04:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to mark more than three consecutive years having the same months?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798821#M314035</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input ID $ CUSIP $ YEAR MONTH ;
cards;
13 92939U 1992      2
13 92939U 1993      3
13 92939U 1992      4
13 92939U 1993      4
13 92939U 1994      4
13 92939U 1993      7
13 92939U 1994      7
13 92939U 1992      8
13 92939U 1993      8
13 92939U 1994      8
13 92939U 1993      9
13 92939U 1994      9
13 92939U 1992    10
13 92939U 1993    10
13 92939U 1994    10
13 92939U 1992    11
13 92939U 1993    11
13 92939U 1994    11
13 92939U 1995    11
50 381317 1993     2
50 381317 1994     2
50 381317 1996     2
50 381317 1997     2  
;
proc sql;
create table want as
select *,range(year)+1=count(*) and count(*)&amp;gt;2 as mark
 from have
  group by id,cusip,month;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Feb 2022 10:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798821#M314035</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-02-26T10:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to mark more than three consecutive years having the same months?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798881#M314060</link>
      <description>Thank you Tom!&lt;BR /&gt;I wrote 20 lines to create this, but you suggested only a few lines!&lt;BR /&gt;It is a great help.</description>
      <pubDate>Sat, 26 Feb 2022 18:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798881#M314060</guid>
      <dc:creator>KS99</dc:creator>
      <dc:date>2022-02-26T18:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to mark more than three consecutive years having the same months?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798882#M314061</link>
      <description>Thank you Ksharp!&lt;BR /&gt;Your coding is even shorter. I will keep them.</description>
      <pubDate>Sat, 26 Feb 2022 18:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mark-more-than-three-consecutive-years-having-the-same/m-p/798882#M314061</guid>
      <dc:creator>KS99</dc:creator>
      <dc:date>2022-02-26T18:28:31Z</dc:date>
    </item>
  </channel>
</rss>

