BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rkk33
Obsidian | Level 7

Hi,

 

What do I have to change in the following SAS program in order to add the lower border to the heading cell ("Powers") that spans two columns:

 

%macro fontSpecs();
	   FONT_FACE = "SAS Monospace"
	   FONT_SIZE = 7pt
	   FONT_WEIGHT = medium
	   FONT_STYLE = roman
	   FOREGROUND = black
	   BACKGROUND = white
%mend;
proc template;
	define style mystyle;
	parent = Styles.rtf;
	STYLE Continued from Continued/ pretext="" font=("SAS Monospace", 0pt) width=0% FOREGROUND=white;
	STYLE parskip from parskip / font =("Arial", 1pt);
	STYLE SystemTitle  / %fontSpecs();
	STYLE Header       / %fontSpecs() ;
	STYLE Data         / %fontSpecs() ;
	STYLE SystemFooter / %fontSpecs();
	STYLE Table        / %fontSpecs()
	   BORDERWIDTH = 1
	   CELLSPACING = 0pt
	   CELLPADDING = 0pt
	   FRAME = ABOVE
	   RULES = GROUPS
	;
	STYLE SysTitleAndFooterContainer /
 		CELLSPACING=0; 
	end;
run;

 

title "What I have now:"; title2; title3; title4; title5;
ods listing close;
ods  escapechar="^";
ods tagsets.rtf file="C:\test.rtf"  style=mystyle;
	data one; do x = 1 to 10; y = x ** 2; z = x ** 3; output; end; run;
	proc report data=one
	            nowindows missing
	            split='|' contents=''
	            style(column)={foreground=black cellspacing=1 just=C VJUST=M }
				style(report)=[font_face='SAS Monospace']
		; 
		columns x ("Powers" y z) ;
		%macro heaColStyle(hjust, cjust, width);
			DISPLAY	
			style(header)=[font_face='SAS Monospace' just=&hjust.] 
			style(column)=[font_face='SAS Monospace' cellwidth=&width.cm just=&cjust.]
		%mend;
		define x / %heaColStyle(c, c, 2.0  ) "X" id;
		define y / %heaColStyle(c, c, 2.0  ) "Y" ;
		define z / %heaColStyle(c, c, 2.0  ) "Z" ;
	run;
ods tagsets.rtf close;
ods listing ;
footnote; footnote2; footnote3; footnote4; footnote5; footnote6; 

 

 

 

Thanks in advanceWhat I have and what I want.png

 

I use SAS 9.2. Thanks in advance !

-- rkk33

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Where you specify the subheading, add in the rtf codes necessary to get the underline: 

ods escapechar="^";
proc report...;
  columns x ("^R'\brdrb\brdrs\brdrw15 'Powers" y z) ;
...

 

View solution in original post

5 REPLIES 5
rkk33
Obsidian | Level 7

Schucks. My SAS code gets truncated. My entire SAS code is in the attachment.

Thanks !

-- rkk33

 

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Where you specify the subheading, add in the rtf codes necessary to get the underline: 

ods escapechar="^";
proc report...;
  columns x ("^R'\brdrb\brdrs\brdrw15 'Powers" y z) ;
...

 

rkk33
Obsidian | Level 7

Hi RW9, Thanks a lot. I am going to try it now. -- rkk3

rkk33
Obsidian | Level 7
It works perfectly. Thanks!
Cynthia_sas
SAS Super FREQ

Hi:

  As an additional comment, for folks who want to do this but who need HTML or PDF, there is a style attribute called "textdecoration" that you can use with ODS ESCAPECHAR and STYLE=JOURNAL to achieve the same result in other destinations. See the code below.

 

cynthia

 

    data one; do x = 1 to 10; y = x ** 2; z = x ** 3; output; end; run;

    title; footnote;
       
    ods escapechar='^';
    ods tagsets.rtf file="C:\temp\test.rtf"  style=journal;
    ods pdf file="c:\temp\test.pdf" style=journal;
    ods html file="c:\temp\test.html" style=journal;
 
    proc report data=one
                nowindows missing
                style(report)={font_face="SAS Monospace" font_size=7pt font_style=roman}
                style(header)={font_face="SAS Monospace" font_size=7pt font_style=roman font_weight=bold}
                style(column)={font_face="SAS Monospace" font_size=7pt font_stype=roman};
        columns x ("^{style[textdecoration=underline]Powers}" y z) ;
    run;
ods tagsets.rtf close;
ods pdf close;
ods html close;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1558 views
  • 2 likes
  • 3 in conversation