Hello,
I am using the proc report , and would like displaying 1 or 2 , 3 …or several levels of spans headers
I would like that the lines of each span header to be separated for the different modalities with a black space
I can do that if I have one level of span header , but not beyond of one level => this is my issue
The two programs bellow illustrate the issue
One span header :
Here the line of the span header is separated by blank space for each modalities ( header11 header12 header13 )
data class;
set sashelp.class;
attrib _empty length=$1;
_empty='';
run;
ods rtf;
ods escapechar='^';
GOPTIONS DEVICE=SASPRTC;
proc report data=class headline headskip split="$" missing
style(header)= [background=white borderbottomcolor=black borderbottomwidth=0.1pt just=center vjust=top] contents=""
style(report)=[ frame=hsides
rules=group
cellpadding=1pt
cellspacing=.15pt
borderwidth=.15pt];
column
('header11' age Height)
('^S={borderbottomcolor=white borderbottomwidth=2}' _empty)
('header12' Name Sex)
('^S={borderbottomcolor=white borderbottomwidth=2}' _empty)
('header21' Weight );
define _empty/' ' style(column)={cellwidth=10 };
define age / order=data style(column)=[cellwidth=1.5 in just=Left];
define Height / order=data style(column)=[cellwidth=1.5 in just=Left];
define Name / order=data style(column)=[cellwidth=1.5 in just=center];
define Sex / order=data style(column)=[cellwidth=1.5 in just=center];
define Weight / order=data style(column)=[cellwidth=1.5 in just=Left];
run;
ods rtf close;
Tow span header
Here the line of the span header is separated by blank space for each modalities ( header11 header12 header21 )
But not for the second level modalities ( header11 header12 header21 )
data class;
set sashelp.class;
attrib _empty length=$1;
_empty='';
run;
ods rtf;
ods escapechar='^';
GOPTIONS DEVICE=SASPRTC;
proc report data=class headline headskip split="$" missing
style(header)= [background=white borderbottomcolor=black borderbottomwidth=0.1pt just=center vjust=top] contents=""
style(report)=[ frame=hsides
rules=group
cellpadding=1pt
cellspacing=.15pt
borderwidth=.15pt];
column
('header1'
('header11' age Height)
('^S={borderbottomcolor=white borderbottomwidth=2}' _empty)
('header12' Name Sex)
('^S={borderbottomcolor=white borderbottomwidth=2}' _empty)
)
('^S={borderbottomcolor=white borderbottomwidth=2}' _empty)
('header2'
('header21' Weight )
)
;
define _empty/' ' style(column)={cellwidth=10 };
define age / order=data style(column)=[cellwidth=1.5 in just=Left];
define Height / order=data style(column)=[cellwidth=1.5 in just=Left];
define Name / order=data style(column)=[cellwidth=1.5 in just=center];
define Sex / order=data style(column)=[cellwidth=1.5 in just=center];
define Weight / order=data style(column)=[cellwidth=1.5 in just=Left];
run;
ods rtf close;
thak you for your help
best regard
Hi
Check this. I made little change in your code and replaced RTF Tags
data class; set sashelp.class; attrib _empty length=$1; _empty=''; run; ods rtf; ods escapechar='^'; GOPTIONS DEVICE=SASPRTC; proc report data=class headline headskip split="$" missing nowd ps=54 style(header)= [background=white protectspecialchars = off just=center vjust=top] contents="" style(report)=[ frame=hsides rules=group cellpadding=1pt cellspacing=.15pt borderwidth=.15pt]; column ('\brdrb\brdrs header1' ('\brdrb\brdrs header11' age Height) _empty ('\brdrb\brdrs header12' Name Sex) ) _empty ('\brdrb\brdrs header2' ('\brdrb\brdrs header21' Weight ) ) ; define _empty/' ' style(column)={cellwidth=10 }; define age / order=data style(column)=[cellwidth=1.5 in just=Left]; define Height / order=data style(column)=[cellwidth=1.5 in just=Left]; define Name / order=data style(column)=[cellwidth=1.5 in just=center]; define Sex / order=data style(column)=[cellwidth=1.5 in just=center]; define Weight / order=data style(column)=[cellwidth=1.5 in just=Left]; run; ods rtf close;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.