It would be better if you post some data and output.
I think you could start with the following code.
data want;
set date cusid;
by date;
run;
The 2025 SAS Hackathon Kicks Off on June 11!
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.