【发布时间】:2014-11-04 22:07:12
【问题描述】:
我的数据中有 90 个变量,我想在 SAS 中执行以下操作。
这是我的 SAS 代码:
data test;
length id class sex $ 30;
input id $ 1 class $ 4-6 sex $ 8 survial $ 10;
cards;
1 3rd F Y
2 2nd F Y
3 2nd F N
4 1st M N
5 3rd F N
6 2nd M Y
;
run;
data items2;
set test;
length tid 8;
length item $8;
tid = _n_;
item = class;
output;
item = sex;
output;
item = survial;
output;
keep tid item;
run;
如果我有 90 个变量来输入这样的数据怎么办?应该有一个很长的清单。我想简化它。
【问题讨论】: