Revise the program in Example 5.1 that lists the observations in a data set in side-by-side panels so that it can be sent to a nonlisting destination using ODS.
Data Set | INVENTORY |
Report Example | Example 5.1 |
Featured Step and Statement | PROC REPORT ODS statement |
Featured Step Statements and Options | ODS statement: COLUMNS= option (SAS 9 only) PROC REPORT statement ODS option: STYLE(COLUMN) |
Additional Features | Macro language functions |
Output Destination of Example | RTF |
Other Examples That Use This Data Set | Example 5.1 |
Example 5.1 created a multipanel report by using the PANELS= option of PROC REPORT. This option is available only when sending the report to the LISTING destination.
A way to create a similar multipanel report that can be sent to a nonlisting destination is to remove the PANELS= option from PROC REPORT and add the COLUMNS= option to the ODS statement that specifies the destination of the report. This example creates a multipanel report of the INVENTORY data set by specifying the COLUMNS= option on the ODS statement.
Example 5.1 set the PANELS= option to 99. This tells PROC REPORT to fit as many panels per page as possible. The COLUMNS= option requires that you specify exactly the number of panels to place per page. You might need to experiment with different values for COLUMNS= to determine the best layout of your report.
The COLUMNS= option does not work when sending output to the LISTING destination. Adding it to the ODS LISTING statement generates an error.
options pageno=1; | |
Do not send results to the LISTING destination. | ods listing close; |
Send subsequent results to the RTF destination and save the results in a file. | ods rtf file='c: eportsexample51.rtf' |
Specify the number of columns per page. | columns=3; proc report data=inventory nowindows box |
Specify the font size of all column cells. | style(column)={font_size=12pt}; |
Place the current date in the title. | title "Parts Listing as of %sysfunc(date(),worddate.)"; column partnmbr quantity price; define partnmbr / 'Part Number'; define quantity / format=3. 'In Stock'; define price / format=dollar6.2 'Price'; run; |
Terminate sending output to the RTF destination. | ods rtf close; |
Send subsequent output to the LISTING destination. | ods listing; |
18.116.238.69