Sort the activities data set by the variables containing the calendar identification and the starting date, respectively.
proc sort data=well.act; by _cal_ date; run;