Proc Report: Tim Hunter, SAS Institute Inc
Proc Report: Tim Hunter, SAS Institute Inc
Intro
PROC REPORT Basics
ODS and PROC REPORT
New in PROC REPORT for 9.2
Questions?
Variable usage
DISPLAY the default
ORDER sort the rows
GROUP consolidate observations into groups
ANALYSIS calculate a statistic
COMPUTED computed by PROC REPORT
ACROSS class variables in the column
dimension
ORDER Variables
Order the rows
GROUP Variables
Consolidate multiple observations
ANALYSIS Variables
Calculate a statistic for the group of observations
represented by a cell in the report
proc report data=sashelp.class;
column age sex n height weight;
define sex / group;
define age / group;
define n / 'N' format=2.;
define height / analysis mean 'Mean Weight' format=6.1;
define weight / analysis mean 'Mean Height' format=6.2;
run;
ACROSS Variables
A column for each value of
the variable
proc report data=sashelp.class;
column age N sex,weight,Mean;
define age / group;
define N / 'Count';
define sex / across;
define weight / analysis;
run;
COMPUTED Variables
define height--weight / display noprint;
define mheight / computed format=6.2 'Height (cm)';
define mweight / computed format=5.2 'Weight (kg)';
compute mheight;
mheight = height * 2.54;
endcomp;
compute mweight;
mweight = weight * 0.4536;
endcomp;
"","Sex",,,
"","Sex",,,
"","Female",,"Male",
"","Female",,"Male",
"","Weight",,"Weight",
"","Weight",,"Weight",
"Age","Count","Mean","Count","Mean"
"Age","Count","Mean","Count","Mean"
11,1,50.5,1,85
11,1,50.5,1,85
12,2,80.75,3,103.5
12,2,80.75,3,103.5
13,2,91,1,84
13,2,91,1,84
14,2,96.25,2,107.5
14,2,96.25,2,107.5
15,2,112.25,2,122.5
15,2,112.25,2,122.5
16,".",".",1,150
16,".",".",1,150
Copyright 2006, SAS Institute Inc. All rights reserved.
STYLE= option
Customizes fonts, colors, image, etc.
Can customize the entire report, just the
headers, individual columns, individual rows
Can also customize LINE statement output,
summary lines
SPANROWS Option
SPANROWS Option