Hi:
When you use the PAGE option with PROC REPORT, that provides one level of control. If you do NOT use the PAGE option, then PROC REPORT tries to put as many rows as possible on each page, subject to the limits of whatever destination is being sent output.
So, for example, if the output is being sent to the LISTING destination, then the margin and pagesize options come into play. If the output is being sent to the HTML destination, then margin and pagesize options have no impact on the output and the output can be as "long" as it needs to be. If the output is being sent to RTF and PDF then margin options might have an impact, but pagesize options would not have an impact.
PROC REPORT writes one report row at a time. It doesn't really have the type of visibility of the lines left on the page that way you envision. Conceptually, PROC REPORT writes one row at a time until it gets close to the area that is allocated to the footnote at the bottom of the page for the destination...by the time PROC REPORT gets to that area on the page, (and only for paged destinations), it can't "go back" and remove rows once they've been written, in order to move them to the next page, such as you suggest.
If you were sending output to the LISTING destination and using a DATA step program with FILE and PUT statements, then there is a LINESLEFT automatic variable that you can test before your program writes a line of output.
You did not say what your destination of interest is. DATA step and the LINESLEFT option sound like what you want -- but only if your destination of interest is the LISTING destination. LINESLEFT may not work in other destinations as it works for the LISTING destination.
I know that one way folks deal with this type of requirement and PROC REPORT is to figure out (for their destination of interest), how many rows will fit on a page and then they "pre-process" the report data so they can tell ahead of time whether their group will all fit in the space allocated -- this technique is easier to implement for the LISTING destination than for other ODS destinations, because a change in font size with a different style could increase or decrease the number of rows that would fit. Basically, they make a dummy page break variable and use that variable with the PAGE option of PROC REPORT in order to ensure that their report rows get written as they desire.
cynthia