0

我是 SAS 的新用户并尝试 proc 报告,

filename exer2 '~/201207Hac.csv';
data work.exercise2;
    infile exer2 dlm="," firstobs=2;
    input Type $ Region $ Country $ City $ Imp Exp Ts; 
run;

proc report data = work.exercise2 nowd headline headskip;
    where type = "M";
    column Region Imp;
    define Region / group 'REGION'; 
run;

输出有两列,其中包含 REGION 和对应的 Imp 值总和。
我想尝试define Imp / Order;但失败了。

虽然我想按降序对小鬼进行排序。我怎样才能做到这一点?谢谢

4

1 回答 1

1

那么你有几个简单的选择。

首先是在proc报告之前做一个proc排序:

PROC SORT DATA = work.exercise2; BY DESCENDING Imp; RUN;

或者您可以订购 proc 报告:

proc report data = work.exercise2 nowd headline headskip;
    where type = "M";
    column Region Imp / order order=data descending;
    define Region / group 'REGION'; 
run;
于 2014-09-30T07:52:07.470 回答