The following program creates the SAS data set that this section uses:
data year_sales;
infile 'your-input-file';
input Month $ Quarter $ SalesRep $14. Type $ Units Price;
AmountSold = Units * Price;
run;
Creating Simple Reports
Displaying All the Variables
By default, PROC REPORT uses all of the variables in the data set. The layout of the
report depends on the type of variables in the data set. If the data set contains any
character variables, then PROC REPORT generates a simple detail report that lists the
values of all the variables and the observations in the data set. If the data set contains
only numeric variables, then PROC REPORT sums the value of each variable over all
observations in the data set and produces a one-line summary of the sums. To produce a
detail report for a data set with only numeric values, you have to define the columns in
the report.
By default, PROC REPORT sends your results to the SAS procedure output. The
NOWINDOWS (NOWD) option does not have to be specified. To request that PROC
REPORT open the REPORT window, specify the WINDOWS option. The REPORT
window enables you to modify a report repeatedly and see the modifications
immediately.
The following PROC REPORT step creates the default detail report for the first quarter
sales:
proc report data=year_sales;
where quarter='1';
title1 'TruBlend Coffee Makers, Inc.';
title2 'First Quarter Sales Report';
run;
The WHERE statement specifies a condition that SAS uses to select observations from
the YEAR_SALES data set. Before PROC REPORT builds the report, SAS selectively
processes observations so that the report contains only data for the observations from the
first quarter. For more information about WHERE processing, see “Selecting
Observations” on page 444.
Creating Simple Reports 505