proc sql;
create table idx_date_1 as
select name, min(date) as idx_dte_1, avg(ret) as avg_ret_1 from dataset
group by name;
quit;
proc sql;
create table idx_date_2 as
select a.name, avg(ret) as avg_ret_2
from dataset a inner join idx_date_1 b on a.name=b.name
where date gt idx_dte_1
group by a.name;
quit;
replace dataset with the name of the real dataset.
here
所有跟帖:
• another try -暖小蛇- ♀ (405 bytes) () 07/13/2010 postreply 19:34:17
• 謝謝!非常感謝! 你太可愛了 -Janezhu- ♀ (0 bytes) () 07/13/2010 postreply 19:48:15