data have;
input
ID
Date :mmddyy10.;
format date mmddyy10.;
cards;
1
11/12/18
1
11/20/18
1
11/28/18
3
6/4/18
3
6/20/18
;
data want;
set have;
by id;
DiffDate=dif(date);
if first.id the DiffDate=.;
run;
data have;
input
ID
Date :mmddyy10.;
format date mmddyy10.;
cards;
1
11/12/18
1
11/20/18
1
11/28/18
3
6/4/18
3
6/20/18
;
data want;
set have;
by id;
DiffDate=dif(date);
if first.id the DiffDate=.;
run;
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.