Example 6.11. Customizing a Multipanel Report Created by PROC REPORT

Goal

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.

Report

Example Features

Data SetINVENTORY
Report ExampleExample 5.1
Featured Step and StatementPROC REPORT ODS statement
Featured Step Statements and OptionsODS statement: COLUMNS= option (SAS 9 only) PROC REPORT statement ODS option: STYLE(COLUMN)
Additional FeaturesMacro language functions
Output Destination of ExampleRTF
Other Examples That Use This Data SetExample 5.1

Example Overview

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.

Program

 
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;


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.4.221