hi, I have spent lot of time trying to figure out how to skip line after a group of observations for tagsets.rtf based output to mimic exactly the skip line functionality available for lst type outputs. i.e. skip line between groups, but not after last group, or after last group but before each page break.
The purpose is to avoid occasional extra pages without any row for data.
One way I did was to insert empty line using compute block before each group, instead of after each group. This almost works but I get stuck with border right above first line. the white gap between columns is present in some pages of report, while not in others.
Other way I am exploring is to conditionally insert line using compute block after each group. But I am not able to find a way to conditionally select/unselect needed records where line skip is needed.
Please help, I really need to set up my programs in the desired way. My code is below:
proc template ;
define style basicrtf;
parent=styles.rtf ;
class fonts /
'TitleFont2' = ("Arial", 9pt, Bold)
'TitleFont' = ("Arial", 9pt, Bold)
'StrongFont' = ("Arial", 9pt, Bold)
'EmphasisFont' = ("Arial", 9pt, Bold)
'FixedEmphasisFont' = ("Arial", 9pt, Bold)
'FixedStrongFont' = ("Arial", 9pt, Bold)
'FixedHeadingFont' = ("Arial", 9pt, Bold)
'BatchFixedFont' = ("Arial", 9pt)
'FixedFont' = ("Arial", 9pt)
'headingEmphasisFont' = ("Arial", 9pt, Bold)
'headingFont' = ("Arial", 9pt, Bold)
'docFont' = ("Arial", 9pt);
class Body from Document /
bottommargin = .75in
topmargin = 1in
rightmargin = 1in
leftmargin = 1in
protectspecialchars= off
;
class table /
background=_UNDEF_
rules=cols
frame=ABOVE
cellspacing=10
cellpadding=2
bordertopwidth=1
bordertopcolor=black
bordertopstyle=solid
borderbottomwidth=0
borderwidth=1pt
BORDERCOLOR=white
outputwidth=100%
;
;
style Header/
background = _undef_
BORDERBOTTOMSTYLE=solid
BORDERBOTTOMCOLOR=white
BORDERBOTTOMWIDTH=1pt
borderbottomstyle=solid
bordertopwidth=1
bordertopcolor=black
bordertopstyle=solid
font= ( "Arial", 9pt,bold)
;
class SystemFooter /
bordertopwidth=1
bordertopcolor=black
bordertopstyle=solid
;
class SystemFooter2 /
bordertopwidth=1
bordertopcolor=white
bordertopstyle=solid
;
end ;
run ;
%let bb=borderbottomwidth=1 borderbottomcolor=black;
options obs=100;
proc sort data=sashelp.cars out=cars;
by origin make model;
run;
options orientation=landscape nonumber nodate ;
ods tagsets.rtf file="C:\SASdata\Development\Dummy-01\TFL\Programs\test-tagset.rtf" OPERATOR='SAS' style=basicrtf
options(continue_tag="no" ) PAGEPANELS=NONE UNIFORM ; *Tables_OFF='SysTitleAndFooterContainer PARSKIP';
* use operator to remove userid from filemeta *;
OPTIONS FORMCHAR="|----|+|---+=|-/\<>*";
footnote1 font=arial justify=left height= 2 '11qqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqq';
footnote2 'This is very very long footnote ......... , asdf sadf,e asdf aswerasdfrtavdferte ,sadfgsdaeryte';
footnote4 justify= left "name" justify= right "progname";;
title1 justify= left "name" justify= right "progname";
title2 'This is title 1\line- adverse event, medical history, etc etc etc';
title3 'treatment population';
data cars2;
set cars;
if 8 <=_n_ <= 31 or 47<=_N_ <=70;
ods escapechar='^';
proc report data=cars2 nowd missing spanrows out=x;
column origin make model type ("^S={&bb} Pricing" msrp invoice ) ;
define origin/order noprint;
define make/order STYLE={CELLWIDTH=3cm just=c} '\ql Make of the car' style(header)={&bb};;
define model/display STYLE={CELLWIDTH=5cm } style(header)={&bb};;;
break after origin/page ;
define type/style(header)={&bb};;;
define msrp/style(header)={&bb};;;
define invoice/style(header)={&bb};;;
compute before make;
line @1 ' ';
endcomp;
/*
compute after make;
_compute_text = ' ';
if ????? then len = 0;
else len = 20;
line _compute_text $varying. len;
endcomp;
*/
compute before _page_/style={font= ( "Arial", 9pt,bold)};
line @1 'Origin:' origin $30.;
endcomp;
run;
ods tagsets.rtf close;
:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.