SAS and page breaks

I can’t seem to find a straight answer to this on the web…

How do you remove page breaks in SAS? I don’t need a separate page for each piece of output that is only three or four lines long! I’ve tried including

options formdlim=’ ';

This removes page breaks on screen, but has no effect when I print. I also tried playing with proc template, which has an option to eliminate breaks in html, but I can’t find anything that will remove them in a pdf.

Any help is appreciated!

There is an option called pagesize(ps), which sets the length (in lines) per page.

In ODS, there’s an option that builds new HTML files by eac page of output, and by each procedure.

Hmmm. I tried both of these:

options ps=60;

ods pdf startpage=never;
No luck with either. SAS still insists on putting each little report on a separate page.

These are the first lines in my program. I even tried them together, though I couldn’t see how that would make a difference. It didn’t.

startpage=never works for me.

What procedure(s) outputs do you want to put on the same page? What version of SAS?

It’s the Learning Edition 4.1 (4.1.99.492). I don’t think this will make a difference, but: I’m running it on Windows 7, and the people at SAS claim it won’t run on anything newer than XP. I think that really means they just won’t support it, as it seems to work just fine for me.

In my current project I’m doing a discriminant analysis using proc discrim. The output is spread over eight pages, while it looks like it would fit just fine on three pages.

Probably a very stupid question, but since I can’t be sure - you are generating a pdf file (i.e. you have an ODS PDF FILE=… statement to create the PDF file) when you try the ods pdf startpage=never, correct? Naturally, ods pdf startpage=never will only affect your pdf output.

I’m generating a pdf, but I just set the program to do so in the options, I haven’t included that line in my program. Is that what my problem is?

Then again… I’m only doing a pdf for this program because it’s a Final Project for a class, and I want the output to look nice. I normally just do text output for regular assignments, and I’ve been having this problem all along.

Ah, the old unsupported OS scheme.

So does your program have an ODS PDF statement or not? Be sure to try enclosing it in:

ods pdf startpage=never;
(program here)
ods pdf close;

You might put

ods trace on;

ods trace off;

lines around your procedure - the log will tell you how the output is produced.

If you want a particular bit of output, you can use ODS to output just that bit.

Anything that starts ODS PDF only affects the PDF destination; it doesn’t affect any other destination (LISTING, HTML, RTF, etc.). I just checked the documentation; ODS LISTING STARTPAGE=NEVER won’t help you either since it’s not a valid option for the LISTING destination. So, make sure you are actually generating a PDF and then check the PDF. If it’s not working there then I’m out of ideas - I’d have to see the program.

I wasn’t very clear at all, was I? Sorry 'bout that. What I meant was, I set the options in the tools menu in the SAS application itself to create a pdf file as my output, and hadn’t tried adding the “ods pdf file=” line in my program instead.

I just did so, and it works - a little too well. :slight_smile: I’ll have to play with it to get it looking right, but I think I’m on my way now.

I still need to figure out how to stop page breaks when my output is plain text, though, but that’s not urgent - I won’t be writing any more programs until next month, when school starts back up.

Thanks everyone!

See the STARTPAGE= doc here:
http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/a002217095.htm#a003064891
I think you could try STARTPAGE=NEVER (or NO) / STARTPAGE=NOW as needed.

For example, you could put:

ods pdf startpage=never;

proc soandso;
run;

ods pdf startpage=now;

proc print data=blah;
run;

pds pdf startpage=never;

proc suchandsuch;
run;

ods pdf close;