- data pooling;
- do group = 1001 to 1003;
- do month = 1 to 30;
- sales = ceil(ranuni(12345)*1000);
- output;
- end; end;
- run;
- data moving_max;
- array temp{0:11} temp0-temp11;
- i = 0;
- do until (last.group);
- set pooling;
- by group;
- n = mod(i, 12);
- temp[n]= sales;
- maxsale = max(of temp{*});
- do k = 0 to 11;
- if missing(temp[k]) then call missing(maxsale);
- end;
- i+1; output;
- end;
- keep group month sales maxsale;
- run;


雷达卡



京公网安备 11010802022788号







