Hi Rick, there should be a ':' after 'output' in your code. %let analysis_date = "19dec2011"d; Data first_cpn_dt; input first_cpn_dt:mmddyy10.; format first_cpn_dt mmddyy10.; cards; 05/01/2010 06/15/2010 01/01/2007 07/16/2010 07/26/2010 09/01/2006 11/26/2010 12/01/2010 12/11/2009 12/14/2009 12/15/2010 ; data temp(drop=i); set first_cpn_dt; format t_incrt pre mmddyy10.; do i=1 to 999 ; t_incrt=intnx('month',first_cpn_dt,3*i); if t_incrt>&analysis_date then do; pre=intnx('month',t_incrt,-3); leave; end; end; proc print;run; first_ Obs cpn_dt t_incrt pre 1 05/01/2010 02/01/2012 11/01/2011 2 06/15/2010 03/01/2012 12/01/2011 3 01/01/2007 01/01/2012 10/01/2011 4 07/16/2010 01/01/2012 10/01/2011 5 07/26/2010 01/01/2012 10/01/2011 6 09/01/2006 03/01/2012 12/01/2011 7 11/26/2010 02/01/2012 11/01/2011 8 12/01/2010 03/01/2012 12/01/2011 9 12/11/2009 03/01/2012 12/01/2011 10 12/14/2009 03/01/2012 12/01/2011 11 12/15/2010 03/01/2012 12/01/2011 Linlin
... View more