Hi all,
how/can we force a page break in a COMPUTE BLOCK based on a variable like in DATA STEP programming using PUT _PAGE_ ??
I do NOT mean :
compute before xxxx _page_;
endcomp;
Regards,
Herman
Hi:
If you are only using the SKIP variable for your forced page break, try this combination of BREAK/RBREAK statements:
BREAK AFTER gr_age / SUMMARIZE ;
break before skip / page ;
RBREAK AFTER / SUMMARIZE ;
I believe that you will get the grand total placed on the last page if you do a BREAK BEFORE SKIP.
Also, I would recommend that you make the GR_AGE variable an ORDER variable instead of a GROUP usage variable. You should be seeing this in the log:
NOTE: Groups are not created because the usage of xxxxxx is DISPLAY. To avoid this note, change all GROUP variables to ORDER variables.
cynthia
A page break in proc report is achieve usually by break after/before.
You can not make a page break in compute block. But you can make a variable to break at appropriate place
by using break after/page.
Ksharp
indeed, this seems to be the only solution and it works!!
however, the reporting total also skips to a new page ???
that's the only issue I have so far
quick example:
title;
ODS LISTING CLOSE;
ODS PDF NOTOC FILE='c:\temp\mypdf.pdf' STYLE=SASWEB NOTOC;
proc sort data=sashelp.class;
by age;
run;
data WORK;
set sashelp.class;
if age < 13 then skip=0;
else skip=1;
gr_age=put(age,z4.) ;
run;
proc report data=WORK nowd;
column skip name sex gr_age age ;
define skip / noprint group;
define name / display;
define sex / display;
define gr_age / noprint group;
define age / analysis ;
BREAK AFTER gr_age / SUMMARIZE ;
break after skip / page ;
RBREAK AFTER / SUMMARIZE ;
quit;
ODS PDF CLOSE ;
ODS LISTING ;
Hi:
If you are only using the SKIP variable for your forced page break, try this combination of BREAK/RBREAK statements:
BREAK AFTER gr_age / SUMMARIZE ;
break before skip / page ;
RBREAK AFTER / SUMMARIZE ;
I believe that you will get the grand total placed on the last page if you do a BREAK BEFORE SKIP.
Also, I would recommend that you make the GR_AGE variable an ORDER variable instead of a GROUP usage variable. You should be seeing this in the log:
NOTE: Groups are not created because the usage of xxxxxx is DISPLAY. To avoid this note, change all GROUP variables to ORDER variables.
cynthia
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.