就是frame = hsides rules = group在起作用,style(report) = {}等选项直观意义,参考SAS inline formating STYLE常用选项
options nodate ; ods rtf file = './_3.rtf'; proc report data = sashelp.class style(report)={frame = hsides rules = group } ; column name sex age height weight; define name / display; define sex / display; define age / display; define height / display; define weight / display; run; ods rtf close;
proc report 常用选项
nowindows missing spanrows center split = " " colwidth = 2 formchar(2) = '-'
missing:对GROUP ORDER ACROSS变量,缺失值认为是有效值
style(report) = {
frame = hsides rules = group just = center width = 100%
cellpadding = cellspacing =
}
style(header) = {
just = center vjust = bottom fontsize = 9pt fontweight = light fontfamily = 'Courier New' backgroundcolor = _undef_
}
style(column) = {
just = center vjust = top fontsize = fontweight = fontfamily = "" asis = on 如果在这指定just = 则在define中just就无效了。
just = dec 小数点对齐,是靠右对齐
}
asis 就是保护空格,防止压缩空格。比如,a = " 1",如果不加asis = on, 如果在一行开头,空格就都没了。如果多个空格存在于单词之间,无需考虑,把每个空格当做字母。
style(lines) = {
just = center fontsize = fontweight = fontfamily = protectspecialchars = on
}
其它:
ods rtf file = ''
bodytitle 把title和footnote作为正文的一部分,默认是不作为正文的一部分。
startpage = group
;中的选项;
* ls = 200 只在ODS LISTING 中有效,在这无效 spacing = 0 列之间的间隔,只在listing中有效 headerline headskip只在listing中有效 colwidth = 5,列宽,会被define的widht语句覆盖 spanrows group的时候,这个变量只在一个group显示一次 split = '~' 遇到这个字符就换行 missing 对缺失值,当成正常字符处理 _undef_ 可以是一切属性的值,未定义 formchar(7) = '+'. 当computer计算一些统计量时或者PROC REPORT系统自动添加一些分割线时,使用这个字符 center|nocenter 居中还是左对齐,会被style(report)中的选项覆盖 ; proc sort data = sashelp.class out = class; by sex; run; options nodate ; ods rtf file = './_3.rtf'; proc report data = class out = _a nowindows nocenter colwidth=5 spanrows formchar(7)='+' split='`' missing style(report)={frame = hsides rules = group just = center cellpadding = 1 cellspacing = 0.02 width = 100%} style(header) = {just = center vjust = bottom font_size = 9pt font_weight = light font_face = 'Courier New' backgroundcolor = _undef_} style(column) = {just = center vjust = top font_size = 9pt font_weight = light font_face = 'Courier New' asis = yes} style(lines) = {just = center font_size = 9pt font_weight = light font_face = 'Courier New' protectspecialchars = off} ; column sex name age height weight; define sex / group ; define name / display; define age / display; define height / display; define weight / display; compute after; line '====='; endcomp; run; ods rtf close;