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.
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 16. 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.