I use to work on regular SAS but we decided to move to EG. Most of the break and skip statements are not breaking/skipping at the right positions. Below is the sample code - How to modify the below break and skip statement so that they work right in EG?
proc report data=all headline spacing=1 split='|' nowindows missing;
column page ord stat visit ("_Cohort_" treat1-treat&numtrt) total;
define page / order order = internal noprint;
define ord / order order = internal noprint;
define stat / display ' ' width=22;
define visit / display 'Visit' width=8 flow id;
%do i=1 %to &numtrt;
define treat&i / width=18 center "&&trttxt&i~n(N=&&ntrt&i)";
define total / width=18 center "Total~nN=%sysfunc(compress(&BigN)))";
break after page / page;
break after ord / skip;
BREAK, SKIP, HEADLINE, HEADSKIP, DOL, DUL, OL, UL, WIDTH, FLOW, PANEL and BOX are some of the "LISTING" only options of PROC REPORT. This means that options, like SKIP that worked in LISTING are basically ignored by ODS destinations, such as RTF, PDF or HTML.
If you had a program with:
BREAK AFTER BRKVAR/ SUMMARIZE SKIP;
for example, you would need to move to a COMPUTE block syntax to accomplish the equivalent of a skipped line. And, in your COMPUTE block, you would achieve a skipped line with a LINE statement:
BREAK AFTER BRKVAR/ SUMMARIZE;
COMPUTE AFTER BRKVAR;
LINE " ";
There have been many previous forum postings on the fact that there are some LISTING only options that do not work with the other ODS destinations when you use PROC REPORT (and PROC TABULATE, for that matter).
For more information about the fact that these LISTING-only options do not work with other ODS destinations, see this Tech Support note: http://support.sas.com/kb/2/549.html
and this "workaround" example code for how to simulate some of the options (mostly using CSS style properties): http://support.sas.com/rnd/base/ods/templateFAQ/report1.html (do note that the CSS style property method of simulating PROC REPORT options will generally only work for ODS HTML or HTML based ODS output -- many of the CSS methods will NOT work for RTF and PDF.)
PAGE is not one of the options that are LISTING only. PAGE should work as designed for ODS RTF and ODS PDF. Since ODS HTML is not a 'paged' destination (there are no pagebreaks in a browser) -- the only destination where PAGE would not work would be ODS HTML and probably ODS CSV, etc.
The code below worked for me to create 3 pages of output in RTF and PDF output files. Of course, in the HTML file, although there weren't page breaks, there was a horizontal rule shown in the SASWEB style that indicated where the "logical" page breaks were. Some styles do not use the horizontal rule as a logical page break indicator -- but SASWEB does -- so you should see a horizontal rule in the HTML file. But you said you were interested in RTF and if you try my code, you should see 3 pages of output in the RTF file.
You will not be able to cut and paste directly from the forum posting into SAS or your EG code node, however, The forum "preformatting" for line feeds and carriage returns is sometimes ignored by SAS or the EG code window. So you'll have to cut and paste from the forum posting into Word and then cut and paste the code a second time from Word into the EG code node window.
The ODS _ALL_ CLOSE; statement at the top of the program turns off the AUTOMATIC generation of output that EG turns on by default. So if you have a default location where EG normally puts your output, do note that these programs all create output in the C:\temp directory.
ods _all_ close;
options nodate number pageno=1;
ods html file='c:\temp\trypage.html' style=sasweb;
ods rtf file='c:\temp\trypage.rtf';
ods pdf file='c:\temp\trypage.pdf';
proc report data=sashelp.shoes nowd;
where region in ('Africa', 'Asia', 'Canada');
column region product sales inventory returns;
define region / group;
define product / group;
define sales / sum;
define inventory / sum;
define returns / sum;
break after region / page summarize;
ods _all_ close;
As in my first post - I have 16 columns. The ODS RTF was able to output as below.
Both sections are appearing on the same page. However, I want the data from Col9 thru 16 to appear in next page. How can this be achieved?
I didn't focus much on your PROC REPORT code because it looked like you didn't post the whole macro program that you were using. And you initially asked about the BREAK and SKIP not working as you expected. Using the PAGE option on the BREAK statement does work as advertised.
I believe your issue is not with the PAGE option. The LISTING destination works one way as far as dealing with output that's too wide to fit in the LINESIZE. The RTF, PDF and HTML destinations work another way as far as dealing with output that's wide.
For one thing, ODS HTML output can be as wide as it needs to be -- since the browser can scroll (almost) infinitely to the right and the left. ODS RTF and ODS PDF output, on the other hand, are bound by physical page dimensions and paper sizes and margins and font sizes. So a report with a LOT of columns will display one way in LISTING (dependent on the LINESIZE, margin, and orientation options) and RTF and PDF will display another way (depending on the ODS style being used, the font sizes, the paper sizes, the system margin settings, the orientation settings, etc). ODS HTML will display an entirely different way.
The way that RTF and PDF will "break" wide tables is not the same as the way that the LISTING destination will "break" wide tables. RTF and PDF decide how many columns can fit in the width of the page, given the factors that I listed above and then will print ALL the rows for those columns before displaying ALL the rows for the rest of the columns. This is different behavior than what you would have observed in the LISTING destination.
You will not be able to get one page of columns 1-8 and the next page showing columns 9-16 from PROC REPORT by default. What you describe is the type of paging behavior that you would only see in the LISTING destination -- not RTF, PDF or HTML behavior. You may have to rethink your approach for this report.
Since you were using ODS ESCAPECHAR control characters, I assumed that you were no longer interested in LISTING output -- therefore, you might want to remove the SPACING, FLOW, WIDTH, HEADLINE and other LISTING only options from your code, as they are going to be ignored anyway.
Of course, one thing you could always do is continue to produce LISTING output, and capture the LISTING output in an ASCII text file. You could then open the ASCII text file directly with Microsoft Word and manually manipulate the output in Word to have the margins, orientation, etc that you desire. Or, you might find it easier to work to make the wide output fit into an ODS RTF output file so that all 16 columns fit on one page -- possibly by using the techniques shown in my "very wide table" forum posting.