Hi all,
I am trying to do something that should be simple but despite googling I can not find the answer. I have code that produces a contact history per client and all I want to do is increase the space between the tables. I know I can use a compute after page but then it puts the bottom border after the space and this looks horrible.
I've shown below where I want the space - can anyone please help?
I dont want to put the space above the table if possible as this will also look horrible (this is part of a wider report).
My code is:
options orientation = landscape
papersize = A4
nodate
nobyline
nonumber
missing = ''
nocenter
topmargin = "0cm"
bottommargin = "0cm"
leftmargin = "1.5cm"
rightmargin = "1cm" ;
ods graphics no ;
goptions dev=png;
ods noresults escapechar = '~' ;
ods pdf file = "/Demog/test.pdf"
compress = 9
uniform
pdftoc = 1
startpage = no
style = Journal ;
ods proclabel = "Contact History" ;
title1 c='#0B8080' h=14pt f='Arial' bold 'Contact History';
proc report data = contact_history nowd
style(header)=[foreground = #0B8080
font_size=12pt
font_face = arial
fontstyle = roman
just = l
font_weight = light]
style(column)=[font_size=10pt
font_face = arial
just = left]
style(lines)=Header{font=(Arial, 12pt)
bordertopcolor= white
foreground = #0B8080 just = l};
by swn client ;
column swn client contact cd_type_wid startdt profile_end ;
define swn / noprint order order=internal ;
define client / noprint ;
define contact / 'Contact' style = {cellwidth = 8cm} ;
define cd_type_wid / 'Type' style = {cellwidth = 3cm} ;
define startdt / 'Start Date' format = ddmmyy10. style = {cellwidth = 3cm} ;
define profile_end / 'End Date' style = {cellwidth = 3cm} ;
compute contact;
count+1;
if mod(count,2) then do;
call define(_row_, "style", "style=[background=#DBECEC]");
end;
endcomp;
compute before _page_;
pgstr = catx(' ',client,cats('(',swn,')'));
line pgstr $varying100. ;
endcomp;
break after swn / page;
run ;
ods pdf close ;
Any help, really appreciated.
regards
Steve
In the compute blocks you can specify a style, this allows you to set the cell height.
See this code example, the yellow background is just to show the area that is taken by the compute after _page_ style definition.
You do need the LINE statement otherwise nothing is produced.
proc sort data=sashelp.class out=class_s;
by age;
run;
ods pdf file="c:\temp\sample.pdf" startpage=no style=journal;
proc report data=class_s
style(report) = { width=100pct }
;
by age;
column age name sex height;
define age / display noprint;
define name / display;
define sex / display;
define height / analysis sum;
compute after _page_ / style={height=2cm background=yellow just=l BORDERBOTTOMcolor=white};
/* line "after page for " age z4.;*/
line " ";
endcomp;
run;
ods pdf close;
Hi:
Is this closer to the spacing you want:
Experiment with adding blanks in the COMPUTE BEFORE _PAGE_. After I made some fake data from SASHELP.CLASS, that's what gave me the wider gap between BY groups.
Cynthia
In the compute blocks you can specify a style, this allows you to set the cell height.
See this code example, the yellow background is just to show the area that is taken by the compute after _page_ style definition.
You do need the LINE statement otherwise nothing is produced.
proc sort data=sashelp.class out=class_s;
by age;
run;
ods pdf file="c:\temp\sample.pdf" startpage=no style=journal;
proc report data=class_s
style(report) = { width=100pct }
;
by age;
column age name sex height;
define age / display noprint;
define name / display;
define sex / display;
define height / analysis sum;
compute after _page_ / style={height=2cm background=yellow just=l BORDERBOTTOMcolor=white};
/* line "after page for " age z4.;*/
line " ";
endcomp;
run;
ods pdf close;
Thanks all for replying, really appreciated. Bruno your solution is perfect thanks. I was trying all sorts in the compute after page style but didn't have the line in.
regards
Steve
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.