Table of Contents
Introduction ........................................................................................................1
Detail Reports versus Summary Reports .................................................................. 1
SAS Report Writing Tools ........................................................................................... 2
Introduction to the REPORT Procedure.................................................................... 3
Creating Detail Reports ....................................................................................4
Invoking the REPORT Procedure .............................................................................. 4
Shaping the Basic Report Layout ............................................................................... 6
Selecting Variables ............................................................................................................................ 7
Defining Variable Usage ................................................................................................................. 10
Defining Variable Attributes........................................................................................................... 13
Defining Statistics .......................................................................................................................... 15
Report Definitions....................................................................................................... 19
Storing Report Definitions.............................................................................................................. 20
Using Stored Report Definitions..................................................................................................... 22
Enhancing the Appearance of the Detail Report ................................................... 23
Modifying Column Appearance ...................................................................................................... 24
Setting Report Options ................................................................................................................... 29
Setting System Options .................................................................................................................. 34
Adding Titles and Footnotes ........................................................................................................... 37
Refreshing the Report Display ........................................................................................................ 40
PROC REPORT Language Statements.................................................................... 41
Viewing the PROC REPORT Language Statements...................................................................... 41
Storing the PROC REPORT Language Statements ....................................................................... 41
Ordering and Totaling Rows..................................................................................... 44
Defining an ORDER Variable ........................................................................................................ 45
Modifying the Default Ordering Sequence ..................................................................................... 49
Creating Break Lines....................................................................................................................... 50
Paging Through the Report............................................................................................................. 57
Adding Variables to the Report ................................................................................ 59
Adding a Computed Variable.......................................................................................................... 59
Hiding Unnecessary Variables........................................................................................................ 62
Creating and Applying User-defined Formats....................................................... 66
Creating User-defined Formats....................................................................................................... 66
Applying User-defined Formats in PROC REPORT...................................................................... 69
Subsetting the Report ................................................................................................. 72
Subsetting the Report Temporarily ................................................................................................. 73
Subsetting the Report Permanently ................................................................................................ 74
Subsetting the Report Based on a Condition ................................................................................... 75
Altering the Report Structure.................................................................................... 82
Creating Summary Reports............................................................................84
Grouping Rows............................................................................................................ 84
Defining a GROUP Variable .......................................................................................................... 87
Breaking on GROUP Variables ...................................................................................................... 91
Creating Summarized Output Data ......................................................................... 93
Calculating Percentages ............................................................................................. 95
Traffic Lighting............................................................................................................ 98
The CALL DEFINE Statement ....................................................................................................... 98
Customizing Break Lines......................................................................................... 102
The LINE Statement ..................................................................................................................... 102
The $VARYING. Format.............................................................................................................. 102
The PUT Function ........................................................................................................................ 103
The LENGTH Function................................................................................................................ 103
Advanced Report Writing Techniques ......................................................109
Creating Cross-tabular Reports............................................................................... 109
Defining an ACROSS Variable..................................................................................................... 109
Presenting the Same Column in Different Ways................................................. 120
Complex Grouping.................................................................................................... 123
Creating Multi-column Reports.............................................................................. 130