First the relatively easy part. When you have an actual SAS date value you can create groups that SAS procedures will recognize by using a Format. So if you use a format such as YYQ6 with a date value in proc means or summary you create calendar groups.
I don't have your data and this may not work if you have enough combinations of date and company:
Proc summary data=have nway;
class date company;
format date yyq6.;
var return;
output out=want (drop= _freq_ _type_) mean =;
run;
You would need a pass through a data step to ensure the date value was the end of the quarter as this approach tends to keep the earliest value actually encountered in the data for the group.
Alternatively you could create a new variable that holds the desired value and then summarize:
Data need;
set have;
endofquarter = intnx('quarter', date,0,'E');
format endofquarter ddmmyy10.;
run;
proc sort data=need;
by endofquarter company;
run;
proc summary data=need;
by endofquarter company;
var return;
output out=want mean=;
run;
Now for the bad news: averaging daily percentages is very likely not going to yield a true percentage unless the number of values is exactly the same for every single day of record per company.
An easy example of one rate and why you may want to reconsider, or redefine, the problem.
Suppose I drive a car and for 1 mile I am costing downhill and on only use 0.01 gallons of gas, the mpg=100. Then I drive the next 100 miles and use 5 gallons or mpg=20. So would the average mpg across that tripe be the mean (100+20)/2 = 60?