BookmarkSubscribeRSS Feed
reznac
Obsidian | Level 7

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;

One_span_header_level.JPG

 

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;

Tow_span_header_level.JPG

thak you for your help 

 

best regard 

 

 

1 REPLY 1
Rajaram
Obsidian | Level 7

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;

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2777 views
  • 0 likes
  • 2 in conversation