How do I achieve to get a dataset with first.dot make in the following example.
data cars;
set sashelp.cars;
run;
proc sort data=cars out=carrs;
by make descending type;
run;
data carstype;
set carrs;
by type;
if first.type;
run;
Error in the log:
data carstype;
19621 set carrs;
19622 by type;
19623 if first.type;
19624 run;
ERROR: BY variables are not properly sorted on data set WORK.CARRS.
Make=Acura Model=NSX coupe 2dr manual S Type=Sports Origin=Asia DriveTrain=Rear MSRP=$89,765
Invoice=$79,978 EngineSize=3.2 Cylinders=6 Horsepower=290 MPG_City=17 MPG_Highway=24 Weight=3153
Wheelbase=100 Length=174 FIRST.Type=1 LAST.Type=1 _ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 2 observations read from the data set WORK.CARRS.