我用一个例子来分享下ADVANCE REPORT
我们一般用PROC REPORT 是为了与ODS一起用,做出符合要求的RTF格式的LISTING,比如,要做出如下表格:
首先,你得做出符合要求的数据集格式,然后再用PROC REPORT输出成这样的RTF,这里我只分享下REPORT语句,数据集的做法需要分享欢迎私聊:
proc report data=final nowd split="|";
column grp label (“性别” “@P/RTF’\fs0\brdrb\brdrs\brdrw20” col1 col2 ) col3 ;
define grp/ order order=internal display;
define label/ “” display style={width=20% just=l};
define col1/ “男性” display style={width=20% just=c};
define col2/ “女性” display style={width=20% just=c};
define col3/ “总计” display style={width=20% just=c};
computer after grp;
line “”;
endcomp;
run;
这样就可以实现上图的展示了。下面我简单讲解析下:
1、GRP 这个变量主要是用来加年龄和BMI之间的空行;
2、括号里面是用来分级的。
3、 “@P/RTF’\fs0\brdrb\brdrs\brdrw20” 用来加下面那跟线。
这些语句基本就能实现一般LISTING的要求啦;
欢迎大家批评指正哦!!