如何使用 proc 报告获取 rtf 文件

Posted

技术标签:

【中文标题】如何使用 proc 报告获取 rtf 文件【英文标题】:how to get rtf file using proc report 【发布时间】:2022-01-03 19:55:03 【问题描述】:

我需要以附件形式获得输出。 我的代码如下所示。 我使用了 headskip,但它没有反映在我的 rtf 文件中

ods rtf FILE="E:\GRAPHS/demog2.rtf" ;
         OPTIONS LS=100 PS=100 NODATE CENTER NONUMBER MISSING='' FORMDLIM='*' ;
         proc report data=finalt  headskip headline center spacing=5 split=" "  nowd
         style(header)=background=white foreground=black
        STYLE(REPORT)=[BACKGROUND=WHITE /*BORDERCOLOR=BLACK*/  ASIS=ON  CELLPADDING=1.5
                         CELLSPACING=1.0 OUTPUTWIDTH=50%  ] /*style=[frame=hsides BORDERWIDTH = 0.1pt]*/style=journal ;

【问题讨论】:

Headskip 是不适用于 LISTING 以外的 ODS 目标的选项之一。 获取 ods 目标 rtf 文件标题的另一种选择是什么 headline 对其他 ODS 输出没有影响,但 LISTING 输出。你到底想要什么?在第一行下划线或将第一行的底边框涂成黑色? 【参考方案1】:

我认为您是在询问在 SAS 中生成“三行”表的方法。您可以在 Internet 上找到许多示例。下面是一个很简单的方法:

option nonumber nodate;
title;
footnote;

proc template;
  define style sasuser.custom;
  parent=rtf;
  replace table from output/frame=hsides;
  replace color_list/'bgh'=white;
  end;
run;

ods rtf file="d:\test.rtf" style=custom;
proc report data=sashelp.class;
run;
ods rtf close;

【讨论】:

以上是关于如何使用 proc 报告获取 rtf 文件的主要内容,如果未能解决你的问题,请参考以下文章