REPORT Procedure

Example 18: Using the WIDTH= and CELLWIDTH= Style Attributes with PROC REPORT

Features:
PROC REPORT statement options:
NOWD
STYLE= using WIDTH= attribute

COLUMN statement

DEFINE statement options:
STYLE= option with CELLWIDTH= attribute
STYLE= option with WIDTH= attribute

Details

This example uses PROC REPORT to create a table using ODS style attributes that does the following:
  • sets the cell width of the total report
  • defines the cell width for that column in the ODS output
Refer to Style Attributes Tables in SAS Output Delivery System: User's Guide for details.
Note: The DEFINE statement WIDTH= option changes the width only for tables output in traditional monospace output.

Program

proc report nowd data=sashelp.class style(report)={width=50%}; 
   col name age sex;
   define age / style(column)=[cellwidth=1in];
   define sex / style(column)=[width=10%];
title "Using the WIDTH= and CELLWIDTH= Styles with PROC REPORT";
run;

Program Description

Specify the cell width for all the columns in the ODS output. The NOWD option runs the REPORT procedure without the REPORT window and sends its output to the open output destination. ODS HTML is the output destination used as the default in this example. The STYLE= option used with the WIDTH= attribute sets the cell width for all of the columns in the ODS output.
proc report nowd data=sashelp.class style(report)={width=50%}; 
Specify the Columns to be used.
   col name age sex;
Define a column width using the CELLWIDTH= style attribute.Define the dimensions of the AGE column using the STYLE= option. The style attribute CELLWIDTH= is used to define the column size as 1 inch.
   define age / style(column)=[cellwidth=1in];
Define a column width using the WIDTH= style attribute.Define the dimensions of the SEX column using the STYLE= option. The style attribute WIDTH= is used to define the column size as a percentage of the table size.
   define sex / style(column)=[width=10%];
Specify a table title.Provide a table name and run the SAS program.
title "Using the WIDTH= and CELLWIDTH= Styles with PROC REPORT";
run;

Output

Using WIDTH style attribute on the STYLE= option