Hello,
Can you please help me to produce a blank line in Proc Report after all the column headers and between the first row of the data for every page? Similarly to what the Headline option does for traditional SAS monospace output.
I've tried using the Pretext option, within my define statement but this does not work. i.e. style(header)=[pretext="*\line"].
Many thanks in advance for your help!
Can you illustrate what you mean. Headline underlines the headers, and it should work exactly the same in RTF. Do you mean headskip? Maybe just put an escape char in with a blank:
ods escapechar="^";
...
define firstcolomn / "Hello~World^{newline}";
Sorry I do actually mean the headskip Option:
An example is so I can obtain the following output:
Name Gender
Alice F
Amy F
Andy F
Currently I get the output below:
Name Gender
Alice F
Amy F
Andy F
Thank you Reeza. I believe your suggestion will produce the following output because I have used something similar elsewhere but used ^\line instead of ^{newline}?
Name Gender
______________
Alice F
Amy F
Andy F
I would note, I am not Reeza. I see, the simplest way to do it would be in a compute block:
proc report...;
columns...;
define ...;
break after pge / page; /* Note that pge is a variable defined by you for page splitting, you could use another variable, depends on your data */
compute before pge;
line ' ';
endcomp;
run;
Sorry and thank you RW9.
The code you provided does help when I create my own page breaks. However if I do not create the page break in the correct place, the page doesn't break properly. Please see my example below. Is there a way that the breaks can be honoured, otherwise, can I create the headskip functionality without using break after / page?
Thank you.
goptions reset = all;
data cars;
set sashelp.cars;
constant = "constant";
if _n_ >= 1 and _n_ <= 20 then p = "Page 1";
else if _n_ >= 21 and _n_ <= 40 then p = "Page 2";
else if _n_ >= 41 and _n_ <= 60 then p = "Page 3";
if _n_ <= 60;
keep constant make model type p;
run;
ods escapechar = "*";
*Setting up output template, so that output is similar to the output proced by %openOut1*;
proc template;
define style Styles.rtf_kriss;
parent = styles.X_rtf;
style body from body /
marginleft = 34.5mm
marginright = 34.0mm
margintop = 18.2mm
marginbottom = 14.2mm;
style fonts from fonts;
style table from table /
frame = void
rules = group
backgroundcolor = white
borderspacing = 0pt
cellpadding = 0pt;
class color_list /
'bg' = white
'fg' = black
'bgH' = white
'link' = black;
end;
run;
ods listing close;
ods rtf file='U:\indent_text5.rtf' startpage=no style=styles.rtf_kriss;
ods escapechar='^';
proc report data=cars
style(report)={width=100%} nowd;
column make model type p;
define p / order;
break after p / page;
compute before p;
line " ";
endcomp;
run;
ods rtf close;
I would recommend that you create page breaks yourself, I always do on my outputs. I.e. drop the startpage=no.
If you want a line inserted then you need to have some sort of grouping so that report knows where to insert the line, i.e. do you want the line before each make? You can't say before each page, as your no defining pages. Think of it this way, if you did it via datastep, how would you know when to put a blank line in the dataset.
Thank you for this. In the end I created the blank lines I wanted within the datastep.
style(report)=[pretext="*\line"]. ???
Thank you. Unfortunately that does not work...
How about this one ?
proc report data=sashelp.class nowd;
compute before;
line ' ';
endcomp;
run;
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.