zhangzachary 发表于 2012-2-22 11:32 
我写id你别跟着我写……改成no就行了……
谢谢!
data test;
format no 1.0;
format dt yymmdd10.;
input no dt :yymmdd10. ret @@;
cards;
1 2001-01-01 0.02
1 2001-03-01 0.03
1 2001-04-01 0.02
5 2001-01-01 0.02
5 2001-02-01 0.03
5 2001-04-01 0.02
9 2001-02-01 0.02
9 2001-03-01 0.03
9 2001-04-01 0.02
;
run;
proc sql noprint;
create table a as
select distinct t.no, tt.dt format=yymmdd10., 0 as ret from test t, test tt;
quit;
proc append base=test data=a;
run;
proc sort data=test nodupkey;
by no dt;
run;