data a;
input accountno name $;
datalines;
1.01 x
0.999 harshit
1.99 y
2 kumar
3 manali
;
Run;
proc print; run;
proc format;
value h
0-1='g.0-1'
1-3='g.1-3'
;
run;
proc print data = a;
format accountno h.;
run;
proc summary data = a nway;
class accountno;
format accountno h.;
var accountno;
output out = hpd;
run;
proc print; run;
在proc摘要中它不会采用var accountno也给出
警告:文件WORK.HPD上已存在变量accountno . 警告:重复变量不会包含在输出语句编号1的输出数据集中 . 那么解决方案是什么?
1 回答
不完全确定你想要输出什么,但我可以告诉你为什么你收到警告信息 .
在proc摘要中,您在类语句中使用与在var语句中使用的相同的变量名 . 在referent输出数据集中,该过程让您知道您正在复制变量名称 .
您可以在数据步骤中添加一个额外的变量来写入数据'a';
如果您只想获取类变量的频率,请完全删除var语句,如下所示: