<?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: Filling in Years in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648201#M194117</link>
    <description>&lt;P&gt;A lengthier solution to the one that is already posted but perhaps mine is more easy to understand&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have;
input Study_ID  $  Year;
cards;
    001           9  
    001           9  
    001          10
    001          12
    001          15
    002           2
    002           6
    002           8
;
run ;

proc sql ;
   create table temp as 
      select study_id, min(year) as minyear
         from have 
         group by study_id 
         order by study_id
      ;
quit ;

%let maxyear = 15 ; *set this value to what you desire ;
data template ;
   set temp ;
   by study_id ;
   
   do year = minyear to &amp;amp;maxyear ;
      output ;
   end ;
run ;

data want ;
   merge have template ;
   by study_id year ;
   drop minyear ;
run ;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 May 2020 22:45:16 GMT</pubDate>
    <dc:creator>biopharma</dc:creator>
    <dc:date>2020-05-15T22:45:16Z</dc:date>
    <item>
      <title>Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648168#M194105</link>
      <description>&lt;P&gt;I have a list of people who have visited in certain years. I want to look at the years they didn't visit too up to year 15. How do I add those numbers in?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have:&lt;/P&gt;&lt;P&gt;Study_ID&amp;nbsp;&amp;nbsp; Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want:&lt;/P&gt;&lt;P&gt;Study_ID&amp;nbsp;&amp;nbsp; Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648168#M194105</guid>
      <dc:creator>A_Halps</dc:creator>
      <dc:date>2020-05-15T21:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648172#M194107</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212048"&gt;@A_Halps&lt;/a&gt;&amp;nbsp; Assuming I understand your requirement-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input Study_ID  $  Year;
cards;
    001           9  

    001           9  

    001          10

    001          12

    001          15

    002           2

    002           6

    002           8
	;

data want;
 _n_=.;
 do until(last.study_id);
  set have;
  by study_id;
  _year=year;
  if _n_&amp;lt;year and _n_&amp;gt;. then 
   do _year=_n_+1 to year;
    output;
   end;
  else output;
  _n_=year;
 end;
 if _year&amp;lt;15 then do _year=_year to 15;
  output;
 end;
 drop year;
 rename _year=year;
run;
proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 22:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648172#M194107</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T22:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648191#M194114</link>
      <description>For 001 the first two observations are duplicates. Is that how it appears in your real data or a typo?</description>
      <pubDate>Fri, 15 May 2020 22:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648191#M194114</guid>
      <dc:creator>biopharma</dc:creator>
      <dc:date>2020-05-15T22:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648201#M194117</link>
      <description>&lt;P&gt;A lengthier solution to the one that is already posted but perhaps mine is more easy to understand&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have;
input Study_ID  $  Year;
cards;
    001           9  
    001           9  
    001          10
    001          12
    001          15
    002           2
    002           6
    002           8
;
run ;

proc sql ;
   create table temp as 
      select study_id, min(year) as minyear
         from have 
         group by study_id 
         order by study_id
      ;
quit ;

%let maxyear = 15 ; *set this value to what you desire ;
data template ;
   set temp ;
   by study_id ;
   
   do year = minyear to &amp;amp;maxyear ;
      output ;
   end ;
run ;

data want ;
   merge have template ;
   by study_id year ;
   drop minyear ;
run ;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 22:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648201#M194117</guid>
      <dc:creator>biopharma</dc:creator>
      <dc:date>2020-05-15T22:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648203#M194118</link>
      <description>Yes, It is a duplicate because it has a more specific date (and they are&lt;BR /&gt;different), but I am only looking at years right now. I just dont want to&lt;BR /&gt;delete anything.&lt;BR /&gt;</description>
      <pubDate>Fri, 15 May 2020 22:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648203#M194118</guid>
      <dc:creator>A_Halps</dc:creator>
      <dc:date>2020-05-15T22:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648208#M194122</link>
      <description>Thank you! I have many more columns than just study_id and year. How do I make sure that all of the other columns keep all of the same information from the previous year?</description>
      <pubDate>Fri, 15 May 2020 23:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648208#M194122</guid>
      <dc:creator>A_Halps</dc:creator>
      <dc:date>2020-05-15T23:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648318#M194174</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212048"&gt;@A_Halps&lt;/a&gt;,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;There is a neat trick that I learnt just a few days ago from @novinosrin. Go ahead and give this a try. I have added a satellite variable WEIGHT to the HAVE dataset and tested. A partial print of the final data is produced.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;data have;
input Study_ID  $  Year weight ;
cards;
    001           9  50
    001           9  50 
    001          10  51
    001          12  52
    001          15  54 
    002           2  60
    002           6  62
    002           8  64
;
run ;

proc sql ;
   create table temp as 
      select study_id, min(year) as minyear
         from have 
         group by study_id 
         order by study_id
      ;
quit ;

%let maxyear = 15 ; *set this value to what you desire ;
data template ;
   set temp ;
   by study_id ;
   
   do year = minyear to &amp;amp;maxyear ;
      output ;
   end ;
run ;

data want ;
   merge have template ;
   by study_id year ;
   drop minyear ;
run ;

data real_want ;
   update want (obs=0) want ;
   by study_id ;
   output ;
run ;&lt;/PRE&gt;Obs Study_ID Year weight12345678 &lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;001&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 16 May 2020 16:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648318#M194174</guid>
      <dc:creator>biopharma</dc:creator>
      <dc:date>2020-05-16T16:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648335#M194178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/254033"&gt;@biopharma&lt;/a&gt;&amp;nbsp; Thank you for your modesty and mention of those pleasing kind words. Very satisfying indeed as I recall an amazing encouragement/cheer from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;(a selfless/amazing beautiful person)&amp;nbsp; whose words were my 1st spark in this thread-&lt;A href="https://communities.sas.com/t5/SAS-Programming/total-visits-and-average-score-in-a-datastep/td-p/411675" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/total-visits-and-average-score-in-a-datastep/td-p/411675&lt;/A&gt;&amp;nbsp; Could never thank her enough and will always be indebted forever. And yes, we do disagree in our banter for sure i.e. Tea is unacceptable, coffee is better.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Okay, I would like some fun here too. lol. So extending my previous post with some hash fun &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data have;
input Study_ID  $  Year weight ;
cards;
    001           9  50
    001           9  51 
    001          10  51
    001          12  52
    001          15  54 
    002           2  60
    002           6  62
    002           8  64
;
run ;
%let maxyear = 15 ; *set this value to what you desire ;

data want;
 if _n_=1 then do;
  dcl hash H (dataset:'have(obs=0)',multidata:'y') ;
  h.definekey  ("year") ;
  h.definedata (all:'y') ;
  h.definedone () ;
 end;
 _n_=.;
 do _iorc_=1 by 1 until(last.study_id);
  set have;
  by study_id;
  h.add();
 end;
 do _iorc_=1 to h.num_items;
  set have(keep=study_id year);
  if _n_&amp;lt;year and _n_&amp;gt;. then 
   do year=_n_+1 to year-1;
    output;
   end;
   if h.find()=0 then h.removedup();
   output;
   _n_=year;
 end;
 if year&amp;lt;15 then do year=year to &amp;amp;maxyear;
  output;
 end;
 h.clear();
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great weekend and stay safe.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="forum-author"&gt;
&lt;DIV class="author-20"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 20:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648335#M194178</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-16T20:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648337#M194179</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Neat. I have a very rudimentary understanding of it but see the endless possibilities in the ways it is used. I am studying and perhaps one of these days will be able to post a solution with it. Fascinated and yes, I am looking into the book by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt;.</description>
      <pubDate>Sat, 16 May 2020 19:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648337#M194179</guid>
      <dc:creator>biopharma</dc:creator>
      <dc:date>2020-05-16T19:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648338#M194180</link>
      <description>&lt;P&gt;&lt;EM&gt;"&amp;nbsp;Fascinated and yes, I am looking into the book by&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262" target="_blank"&gt;@hashman&lt;/A&gt;and&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569" target="_blank"&gt;@DonH&lt;/A&gt;."-&amp;nbsp; &lt;/EM&gt;Smart approach.You are in the right track. SAS universe begins and ends with those two. Can't agree more!&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>Sat, 16 May 2020 19:43:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filling-in-Years/m-p/648338#M194180</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-16T19:43:36Z</dc:date>
    </item>
  </channel>
</rss>

