Assuming 日期重叠次数 means the # of same startdate and enddate proc freq data=datset1; by ID; Table startdate/out=outdatset2; run;