I'm late coming into this discussion, but it appears to me that you want the last observed date in each month, which I interpret differently than the ordinary last date.
If so, then you can run a program that looks ahead one record to see if the next record is in a different month than the current record:
proc sort data=have out=need;
by date;
run;
data want (drop=nxt_date);
merge need
need (firstobs=2 keep=date rename=(date=nxt_date));
if intck('month',date,nxt_date);
run;
If your original dataset (named "have" here) is already sorted, skip the proc sort, and apply the merge statement to have instead of need.
The merge statement combines each observation with a single, renamed variable (date=nxt_date) from the following observation (that's from the "firstobs=2" parameter). This allows the intck function to count the number of months between date and nxt_date. Only non-zero results pass the filter - yielding the last observed date of the month.