If I understand your question correctly, what you want is something like this:
create table want as select
count(*) as no_of_firms,
sum(DVC>0) as dividend_payers,
calculated dividend_payers/calculated no_of_firms as pct_dividend_payers format=percent6.2,
sum(sharerepur>0) as repurchasers,
calculated repurchasers/calculated no_of_firms as pct_repurchasers format=percent6.2
group by year
order by year
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.