Sort the data set. PROC SORT sorts the observations by Sale_Type and Order_Date.


proc sort data=exprev;
   by sale_type order_date;
run;