我希望使用IML编写一个宏,该宏能够提取数据集的列名,以便以后作为名称使用。
一些伪码:
proc iml;
read all dataset into matrix_a [colname = varnames];
(...)
names = varnames;
create new_data_set [rownames = names];
quit;这个是可能的吗?
发布于 2013-09-10 17:26:36
当然是。
data test;
array x[10];
do i=1 to 10;
do j=1 to 10;
x[j] = (i-1)*10 + j;
end;
output;
end;
drop i j;
run;
proc iml;
use test;
read all var _num_ into test[colname=names];
close test;
test = test`;
names = names`;
create test_t from test[rowname=names];
append from test[rowname=names];
close test_t;
quit;https://stackoverflow.com/questions/18724945
复制相似问题