I'm trying to create a summary table from a larger table, using just the last row of data. I have the following code:
proc sort data=&data.;
by date;
run;
data &data._summary;
set &data.;
by date;
if last.date;
run;
My understanding is that this should just output one row (for the last value of date), but instead it's keeping all values. What am I doing wrong here?
From the documentation
If you want the last observation in the DATA set you can use the
END=option to set a flag for the last row.