Hey,
Here is an example of using lag function to get what you looking for base on your example:
data temp (drop=ind num2 num3);
length num3 $10.;
input num1 $ num2 $10. num3 $;
num22=input(num2,mmddyy10.);
num33=input(num3,mmddyy10.);
format num22 mmddyy10. num33 mmddyy10.;
ind=lag(num33);
if ind=num22 or ind=num22-1 then new=1;
else if ind=. then new=1;
else new=2;
put _all_;
cards;
x 01/11/2008 01/15/2008
x 01/15/2008 01/30/2008
x 01/31/2008 02/10/2008
x 02/15/2008 02/26/2008
;
run;
... View more