Changing the options orientation= from portrait to landscape midstream does not work. You might be able to set up two ODS templates where one is "sized" to look like it's landscape and then use it for the first page while reverting back to another template for the portrait pages. I don't know if the ODS templates can be manipulated to do that. Something for you to explore. Please be sure to post your findings.
ods pdf file='c:\temp\test.pdf' style=statistical;
*where the statistical template is a landscape template;
proc print data=sashelp.class;
*options orientation=landscape;*this does not work;
Only the RTF destination allows you to switch orientations in mid-stream. ODS PDF does not allow that.
There is nothing in the style template that would fool PDF into creating one page that was portrait and the next page/report that was landscape. So although you had a good idea, it is not really going to work the way you envisioned.
To switch orientations in midstream with ODS RTF, you have to do this:
ods rtf file='twoway.rtf';
** first procedure;
** second procedure;
ods rtf close;
Note that after you switch orientations, you must get ODS RTF to "refresh" the options by issuing an ODS RTF; statement without any other options on the statement. However, this technique does NOT work for ODS PDF.
I have no idea whether this is even possible. PDF files are in a proprietary form and my understanding of how ODS PDF works (conceptually) is that your output is formatted in some buffer area as though it was going to a physical printer and then that internal copy of the printer version of the file is sent to PDF proprietary format. So I don't know whether the Adobe proprietary format that ODS creates has that capability to switch orientations in midstream. My assumption is that if it were possible, the developers would have implemented the capability for PDF at the same time, or shortly after, they implemented it for RTF.
If you send a mail to firstname.lastname@example.org, you could ask the ODS developers whether it's a possibility or not.
Excellent, thanks so much for your response. The only other thing I can think of is creating seperate PDF's, change the system orientation option in between, then somehow merging the two documents.. but I don't see that merge happening in SAS...
Message was edited by: FrankE
You're right, I expect you'd use some Adobe product or 3rd party PDF maker in order to put 2 separate PDF files together. It is a long-standing fact that you can ONLY append outputs using ODS HTML -- you can't append to ODS RTF or ODS PDF files using SAS. That's because the RTF spec and the PDF spec both have VERY rigid rules for what type of file/begin and file/end code is allowed in the output file.