790646223 发表于 2015-8-15 18:55
十分感谢你,最近看到sas有一个例子,问题已经顺利解决,这个例子是这样的,贴出来大家一起学习
十分感谢你,最近看到sas有一个例子,问题已经顺利解决,这个例子是这样的,贴出来大家一起学习
EM Help中有个例子,可以用的,根据这个例子调整下自己的数据吧
注意项目
/*
CUSTOMER: ID role
PRODUCT: target role
TIME: rejected role.
In the Data Source Wizard — Data Source Attributes window, change the data source role from Raw to Transaction.
*/
libname assocs "e:\temp";
DATA assocs.test2;
input customer time item1 item2 item3 item4;
datalines;
1 1 herring corned_b olives .
1 2 ham turkey bourbon ice_cream
2 1 baquette soda . .
2 2 herring cracker heineken olives
2 3 corned_b . . .
3 1 avocado cracker artichok heineken
3 2 ham turkey sardines .
;
run;
PROC TRANSPOSE
data=assocs.test2
out=assocs.seq2(rename=(col1=product)
drop=_name_
where=(product is not missing));
var item1-item4;
by customer time;
run;