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 advance
I use SAS 9.2. Thanks in advance !
-- rkk33
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) ;
...
Schucks. My SAS code gets truncated. My entire SAS code is in the attachment.
Thanks !
-- rkk33
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) ;
...
Hi RW9, Thanks a lot. I am going to try it now. -- rkk3
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;
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.
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.