如何在SAS中将表中的行(uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu?
我想在proc report步骤中将表标题下的行(uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu。 我试着使用选项formchar,但它对我来说仍然不起作用。 你能帮帮我吗?如果需要数据,我可以在聊天中发送给你,因为数据是保密的如何在SAS中将表中的行(uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu?,sas,sas-macro,Sas,Sas Macro,我想在proc report步骤中将表标题下的行(uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu。 我试着使用选项formchar,但它对我来说仍然不起作用。 你能帮帮我吗?如果需要数据,我可以在聊天中发送给你,因为数据是保密的 proc template; %** Courier 9pt **; define style Styles.ods
proc template;
%** Courier 9pt **;
define style Styles.ods_9pt;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New",9pt,Bold )
'TitleFont' = ("Courier New",9pt,Bold )
'FootnoteFont' = ("Courier New",9pt )
'StrongFont' = ("Courier New",9pt )
'EmphasisFont' = ("Courier New",9pt )
'FixedEmphasisFont' = ("Courier New",9pt )
'FixedStrongFont' = ("Courier New",9pt)
'FixedHeadingFont' = ("Courier New",9pt, Bold)
'BatchFixedFont' = ("Courier New",9pt,Bold )
'FixedFont' = ("Courier New",9pt )
'headingEmphasisFont' = ("Courier New",9pt,Bold )
'headingFont' = ("Courier New",9pt,Bold )
'docFont' = ("Courier New",9pt );
replace document from container /
asis = on
protectspecialchars=off;
replace SystemFooter from TitlesAndFooters /
asis = on
protectspecialchars = on
font= Fonts('FootnoteFont');
replace systemtitle from titlesandfooters/
asis = on
protectspecialchars=off;
replace body from document /
asis = on;
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
replace Table from output /
Background=_UNDEF_
cellpadding = 0pt
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
end;
ods listing;
options papersize='LETTER' orientation=landscape topmargin = '3.61cm' bottommargin = '3.61cm'
leftmargin = '2.54cm' rightmargin = '2.54cm' nodate nonumber missing=.;
ods rtf file="/home/u000000/sasuser.v94/Listings/listing_Demo.rtf" style=styles.ods_9pt nogtitle nogfootnote;
ods escapechar = '~';
options formchar='|_---|+|---+=|-/\<>*'
options validvarname=any;
options pageno=1;
proc report data=newb nowd headline headskip split='*';
column num mypage TRT01A SITE BRTHDTC AGE SEX ETHNIC HEIGHTBL WEIGHTBL;
define num/ noprint;
*break after num/skip;
define mypage /order noprint;
break after mypage / page;
define TRT01A/'Treatment' order descending center style(column)={width=1in};
define SITE/'Site Id.*Unique Subject Id.' center style(column)={width=1in};
define BRTHDTC/'Date of*Birth' center style(column)={width=1in};
define AGE/'Age (YEARS)*[1]' center style(column)={width=1in};
define SEX/'Sex' center style(column)={width=1in};
define ETHNIC/'Ethnicity' center style(column)={width=1in};
define HEIGHTBL/'Height*(cm)' center style(column)={width=1in};
define WEIGHTBL/'Weight*(kg)'center style(column)={width=1in};
*compute after TRT01A;
*line '';
*endcomp;
title1 j=l height=10pt font="Courier New" "Protocol: XXX" ;
title3 j=l height=10pt font="Courier New" "Population :XXX" j=r 'Page ^{thispage} of ^{lastpage}';
title4;
title5 j=c height=10pt font="Courier New" "Listing";
title6 j=c height=10pt font="Courier New" "Listing of Demographic Characteristics";
title7;
footnote1 j = l height=10pt font="Courier New" "20NOV2020 10:42";
run;
ods rtf close;
ods listing;
proc模板;
%**信使9pt**;
定义style.ods_9pt;
父项=styles.rtf;
替换字体/
“TitleFont2”=(“Courier New”,第9页,粗体)
“标题字体”=(“Courier New”,第9页,粗体)
“FootnoteFont”=(“快递新”,第9页)
“StrongFont=”(“新快递”,第9页)
“EmphasisFont”=(“新快递”,第9页)
“FixedEmphasisFont'=(“Courier New”,第9页)
'FixedStrongFont'=(“新快递”,9pt)
“FixedHeadingFont'=(“Courier New”,9磅,粗体)
“BatchFixedFont'=(“Courier New”,9磅,粗体)
“FixedFont”=(“新快递”,9pt)
“headingEmphasisFont”=(“Courier New”,第9页,粗体)
“headingFont”=(“Courier New”,第9页,粗体)
“docFont”=(“Courier New”,第9页);
从容器/
asis=on
protectspecialchars=关闭;
从标题和页脚替换系统页脚/
asis=on
protectspecialchars=on
字体=字体(“脚注字体”);
替换标题和页脚中的系统标题/
asis=on
protectspecialchars=关闭;
替换文档/
asis=on;
替换颜色列表
“默认样式中使用的颜色”/
“链接”=蓝色
“bgH”=白色
“fg”=黑色
‘bg’=白色;
从输出替换表/
背景=\u未定义\u
单元格填充=0pt
规则=组
框架=空隙;
从页眉到页眉的样式页眉/
背景=_未定义u;
从Rowheader设置Rowheader样式/
背景=_未定义u;
替换标题和页脚中的页码/
前景=白色;
结束;
ods清单;
选项papersize='LETTER'方向=横向上边距='3.61cm'下边距='3.61cm'
leftmargin='2.54cm'rightmargin='2.54cm'节点无编号缺失=。;
ods rtf file=“/home/u000000/sasuser.v94/Listings/listing_Demo.rtf”style=styles.ods_9pt nogtitle nofootnote;
ods escapechar='~';
选项formchar='||--|+|--+=|-/\*'
选项validvarname=any;
选项pageno=1;
过程报告数据=newb nowd headline headskip split='*';
第num mypage TRT01A列站点BRTHDTC年龄性别种族高度bl权重bl;
定义num/noprint;
*在num/skip之后中断;
定义mypage/订单noprint;
在mypage/页面之后中断;
定义TRT01A/“治疗”顺序降序中心样式(列)={width=1in};
定义站点/“站点Id.*唯一主题Id.”中心样式(列)={width=1in};
定义BRTHDTC/“出生日期”中心样式(列)={width=1in};
定义年龄/“年龄(年)*[1]”中心样式(列)={width=1in};
定义性别/性别中心样式(列)={width=1in};
定义种族/种族中心样式(列)={width=1in};
定义HEIGHTBL/‘Height*(cm)’中心样式(列)={width=1in};
定义WEIGHTBL/‘Weight*(kg)’中心样式(列)={width=1in};
*TRT01A后计算;
*第“”行;
*endcomp;
标题1 j=l高度=10pt font=“信使新”协议:XXX;
标题3 j=l高度=10pt font=“Courier New”人口:XXX“j=r”页面^{此页} 的^{最后一页}';
标题4;
标题5 j=c高度=10pt font=“快递新”列表;
标题6 j=c高度=10pt font=“Courier New”“人口统计特征列表”;
标题7;
脚注1 j=l高度=10pt font=“Courier New”“2020年11月20日10:42”;
跑
ods rtf关闭;
ods清单;
@莉莎:你能帮我一下吗?第一条路
在报告中添加一行
ods rtf file='report.rtf' style=ods_9pt;
data class;
set sashelp.class;
page = 1;
run;
proc report data=class
style(header) = [BorderBottomStyle=hidden]
;
title;
where name < 'H';
columns page name age sex height weight;
define page / order noprint;
compute before page;
line '-----------------------------------------------------------';
endcomp;
run;
ods _all_ close;
到
在Proc报告中
,更改列标题以包含要注入rtf表格单元格的其他原始字符
define TRT01A /
'Treatment*~{dest [RTF] ~{raw -------}}'
order descending center style(column)={width=1in};
技巧(列表)
对于报告
,有一个ODS列表
技巧:
- 如果拆分行是两个相同的formchar字符,则它们将在列宽上重复
FORMCHAR仅适用于列表输出(老式纯文本)。对于HTML、RTF、PDF。。。这个选择无关紧要。您可以自由地输出为旧的纯文本,并且您将有虚线。如果我也删除FORMCHAR,则我无法工作您只能在ODS列表输出(旧的纯文本)中使用FORMCHAR选项!它对PRD、RFT、HTML没有意义,所以您可以删除或保留它,这并不重要。我不知道如何使用模板在RTF或PDF输出中生成“--”行。看看下面Richard的代码。很抱歉谢谢,但是我只在治疗变量下面有一条虚线,但是我想在标题下面有一条虚线continuously@Reeza:你能检查一下吗?你有没有在COMPUTE
块中尝试一个简单的行----“
,请参见编辑的答案我在每列下都有一行,但不是因为一行就可以做到这一点,参见方式1下更新的工作样本
style Header from Header / Background=_undef_ borderbottomstyle=hidden;
define TRT01A /
'Treatment*~{dest [RTF] ~{raw -------}}'
order descending center style(column)={width=1in};
* ODS listing only;
Proc REPORT ...;
...
define TRT01A /
'Treatment*--`
order descending center;
...