What do you want a percent and total of? It isn't clear from your code what you are attempting.
For instance, what is the purpose of this bit of code? I don't see a real need for a new dataset if all you are doing is renaming a variable.
DATA meanout2(DROP=_type_ _freq_);
LENGTH percent 8 ;
SET meanout1;
Percent='' ;
RENAME ageatstart=report_stat;
RUN;
Missed SAS Innovate in Orlando?
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.