losttemple 发表于 2009-9-19 20:42 
建议用proc iml;
同意iml,matlab也可以,把数组(1,1)的位置替换下就可以了,几行就行 如非得是sas 下面可以
data a;
input s;
cards;
0.6875
0.2234
0.7654
0.3322
0.4455
0.3344 /* 这个是原始数据,不能省略的*/
;run;
DATA raw(type=corr); /*这个是初始化*/
_type_='corr';
INPUT X1-X2;
CARDS;
1.00 .
-1 1.00
;
run;
proc sql noprint;
select count(s) into: count from a;quit;
%macro split;
data _null_;
set a;
call symput ('n',_n_);
call symput (compress('sss'||_n_),s);
run;
%mend;
%split;
%macro fun;
%do i=1 %to &count;
data a&i; /*产生需要的矩阵*/
set raw;
if x1=-1 then x1=&&sss&i;
%end;
run;
%mend;
%fun;