data base;
set sashelp.shoes;
where ranuni(0) ge .5 ;
run;
ods listing close;
ods pdf file='c:\x.pdf'; * to test the page size of pdf;
proc print data=base; *column obs is to see how many
lines each page;
run;
*34 is the number of lines in one page pdf;
ods pdf close;
ods listing;
proc means data=base
nway;
class region;
output out=count n=count;
run;
data result;
merge base count(keep=region count);
by region;
run;
data result;
set result;
mod=mod(count,34);
run;
data result; * To decide Page break
point;
set result;
by region;
retain break 1;
if last.region then sum_mod+mod;
if count +sum_mod ge 34 and region ne lag(region) then do;
break+1;
sum_mod=0;
end;
run;
options nolabel;
ods listing close;
ods pdf file='c:\report.pdf';
proc report data=result
nowd spanrows;
column region product subsidiary stores sales inventory returns
break;
define break /group noprint;
break after break /page;
run;
ods pdf close;
ods listing;
Thank you all for giving solution on preventing PDF splitting. The When I convert Word to PDF, some content was split on two PDF pages, I'm looking for a way for solving it.
And finally I get an idea from upper helps.
Thank you so much.
Best regards.
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.