如题,
proc iml;
use data2007; read all var _num_ into matrix_2007 ;
/* do x=1 to ncol(matrix_2007) ;*/
do x= ncol(matrix_2007) to 1;
do y=1 to nrow(matrix_2007);
flag=0;
do j=y to nrow(matrix_2007);
if matrix_2007[j,x]^=0 then flag=flag+1;
end;
if flag=0 then matrix_2007[y,x]=.;
end;
end;
quit;
只能从小到大写/* do x=1 to ncol(matrix_2007) ;*/,程序能够正确运行,
如果从大到小写,
do x= ncol(matrix_2007) to 1;
程序也不报错,但就是运行不出结果啊