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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.