SAS do loop + lag function?
问题 This is my first post, so please let me know if I'm not clear enough. Here's what I'm trying to do - this is my dataset. My approach for this is a do loop with a lag but the result is rubbish. data a; input @1 obs @4 mindate mmddyy10. @15 maxdate mmddyy10.; format mindate maxdate date9.; datalines; 1 01/02/2013 01/05/2013 2 01/02/2013 01/05/2013 3 01/02/2013 01/05/2013 4 01/03/2013 01/06/2013 5 02/02/2013 02/08/2013 6 02/02/2013 02/08/2013 7 02/02/2013 02/08/2013 8 03/10/2013 03/11/2013 9 04