Overview 232
Introduction 232
Objectives 233
Creating a Default List Report 233
Example 235
Example 237
Example 239
Specifying Column Justification 247
Example 247
Enhancing the Heading's Appearance 248
Example 248
Chapter Summary 257
Chapter Quiz 259
List and summary reports are often created from SAS data. To produce a variety of reports using a single report-writing tool, you can use PROC REPORT. In addition to creating list reports, PROC REPORT enables you to
create custom reports
request separate subtotals and grand totals
calculate columns
create and store report definitions.
You can use PROC REPORT in three ways:
in windowing mode with a prompting facility that guides you as you build a report
in windowing mode without the prompting facility
in nonwindowing mode. In this case, you submit a series of statements with the PROC REPORT statement, just as you do in other SAS procedures.
This chapter shows you how to use PROC REPORT by submitting SAS statements. Although PROC REPORT enables you to create highly customized reports, we'll focus on basic statements and will add a few enhancements. By the end of the chapter, you'll create a list report and a summary report.
Let's start by creating a list report. Suppose you want to create a listing of mail, freight, and passenger revenue for flights between LaGuardia Airport and London or Paris.
As with other SAS procedures, you first reference the library in which your data is stored. Then you submit a basic PROC REPORT step.
In this program, PROC REPORT reads the Flights.Europe data set and creates a report in nonwindowing mode:
proc report data=flights.europe nowd;
run;
This is HTML output from the PROC REPORT step. Notice that by default
all observations and variables in the data set are printed
variables appear in the order in which they occur in the data set.
Now let's see how you can choose the data that you want to display.
To select and order the variables that appear in your list report, you can use the COLUMN statement.
You might also want to select rows for your report based on a condition. To select observations, you can use the WHERE statement, just as you have learned to do with PROC PRINT.
In the output that you've seen in this chapter so far, you might have noticed that PROC REPORT displays
each data value the way it is stored in the data set
variable names as column headings in the report
a default width for the report columns
left-justified character values
right-justified numeric values
observations in the order in which they are stored in the data set.
You can enhance the report by
defining how each variable is used in the report
assigning formats to variables
specifying column headings and widths
justifying the variable values and column headings within the report columns
changing the order of the rows in the report.
Let's see how to define variables.
To describe how to use and display variables in your report, you use one or more DEFINE statements. You can list DEFINE statements in any order, and you can list options (usages, attributes, and so on) in any order in a DEFINE statement.
These DEFINE statements specify usages, attributes, options, justification, and column headings for the variables Flight and Orig. In this chapter, you'll look at each of these ways of defining variables.
proc report data=flights.europe nowd; where dest in ('LON','PAR'),
column flight orig dest mail freight revenue; define flight / order descending 'Flight Number' center width=6 spacing=5; define orig / 'Flight Origin' center width=6; run;
Let's start with attributes.
You can easily change the appearance of your PROC REPORT output by specifying attributes for variables. For example, you can select a format for data values, specify the column width, and specify the spacing between columns.
To enhance your PROC REPORT output, you'll use the following attributes.
Attribute | Action |
---|---|
| Assigns a SAS format or a user-defined format to the item. |
| Specifies how many blank characters to leave between the selected column and the column immediately to its left. The default is 2. |
| Specifies the width of the column. The default column width is just large enough to handle the specified format. |
Let's begin with the FORMAT= attribute.
In previous chapters, you learned that formats determine how data values appear in SAS output. If you do not specify a format for a variable within the PROC REPORT step, PROC REPORT uses the format that is stored in the data set. If no format is stored in the data set, PROC REPORT uses the default format for that variable type.
To assign a format to a specific report column, use the FORMAT= attribute in the DEFINE statement for that column. You can specify any appropriate SAS format or user-defined format.
The variable Revenue has no format assigned to it in the Flights.Europe data set. So, in your current report, revenue values appear as shown in the example below.
But suppose you want your revenue figures to be formatted with a dollar sign, commas, and two decimal places, in a total width of 15 positions. To do this, you can assign the DOLLAR15.2 format to Revenue.
proc report data=flights.europe nowd;
where dest in ('LON','PAR'),
column flight orig dest mail freight revenue;
define revenue / format=dollar15.2;
run;
This is part of the HTML output from the program above. Notice that the format supplies the dollar sign, comma, decimal point, and decimal places. However, because the HTML table column conforms to the width of its contents, assigning the format does not increase the column width beyond the length of the data values.
By contrast, the monospace SAS listing of the report does display the increased column width.
In the previous example of SAS listing output, you might have noticed that several headings were wrapped over two lines. (In HTML output, the longest cell value determines the column width, so wrapping doesn't occur.)
If a variable in the input data set doesn't have a format associated with it, the default PROC REPORT column width is
the variable's length for character variables
9 for numeric variables.
The character variables Flight, Orig, and Dest each have a length of 3, and no format is associated with them. So 3 is their default column width.
To specify a width for columns in your report, use the WIDTH= attribute in the DEFINE statement. You can specify values from 1 to the value of the LINESIZE= system option.
The WIDTH= attribute has no effect on HTML output.
To specify column widths that accommodate the column headings for Flight, Orig, and Dest, you can use the following DEFINE statements in your PROC REPORT step:
proc report data=flights.europe nowd; where dest in ('LON','PAR'), column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=6; define orig / width=4; define dest / width=4; run;
Now the headings appear on one line.
Another way to enhance your PROC REPORT output is to specify column spacing, which is the number of blank characters between the selected column and the column immediately to its left. The default column spacing is 2. To specify a different column spacing, use the SPACING= attribute in the DEFINE statement.
The SPACING= attribute has no effect on HTML output.
This is PROC REPORT output without any spacing defined. Orig and Dest have 2 blank characters preceding their columns.
To specify 5 blank spaces before the column headings for Orig and Dest, you can use DEFINE statements as shown below in your PROC REPORT step:
proc report data=flights.europe nowd; where dest in ('LON','PAR'), column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=6; define orig / width=spacing=5; define dest / width=4 spacing=5; run;
Now the two columns display the extra spacing.
In addition to specifying column widths and spacing, you might want to change column headings. To define a column heading, specify the heading text in quotation marks in the DEFINE statement.
Suppose you want to label Flight as Flight Number, Orig as Flight Origin and Dest as Flight Destination. Add these column headings to the DEFINE statements, being sure to match quotation marks. You can also change the WIDTH= specifications to accommodate the new headings.
proc report data=flights.europe nowd; where dest in ('LON','PAR'),
column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=13 'Flight Number'; define orig / width=13 spacing=5 'Flight Origin'; define dest / width=18 spacing=5 'Flight Destination'; run;
This is HTML output from the same program:
Now you have the column headings that you want. But the columns are quite wide, aren't they? Let's see what you can do to fix this.
To control how words break in column headings, you can use a split character in the column label. When PROC REPORT encounters the split character in a column heading, it breaks the heading and continues the heading on the next line. The split character itself does not appear in the heading.
To use a split character, you can do either of the following:
Use the default slash (/) as the split character.
Define a split character by using the SPLIT= option in the PROC REPORT statement.
Suppose you want to break headings so that only one word appears on a line. Using the default slash as the split character, you can submit this PROC REPORT step. Notice that the column width has been reduced.
proc report data=flights.europe nowd; where dest in ('LON','PAR'), column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=6 'Flight/Number'; define orig / width=6 spacing=5 'Flight/Origin'; define dest / width=11 spacing=5 'Flight/Destination';
run;
Or you can submit this program, which uses the SPLIT= option and produces exactly the same output:
proc report data=flights.europe nowd split='*'; where dest in ('LON','PAR'), column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=6 'Flight*Number'; define orig / width=6 spacing=5 'Flight*Origin'; define dest / width=11 spacing=5 'Flight*Destination'; run;
Here are both types of output from both programs:
You might also want to specify justification for columns in your report. Remember that by default, PROC REPORT left-justifies character variables and right-justifies numeric variables. For each variable that you define, you can specify the justification option CENTER, LEFT, or RIGHT in the DEFINE statement.
Each option justifies both the formatted values of the report item within the column width and the column headings over the values.
To center headings and values for Flight, Orig, and Dest, you can specify the CENTER option as shown below in your DEFINE statements:
proc report data=flights.europe nowd;
where dest in ('LON','PAR'),
column flight orig dest mail freight revenue;
define revenue / format=dollar15.2;
define flight / width=6 'Flight/Number' center;
define orig / width=6 spacing=5 'Flight/Origin' center; define dest / width=11 spacing=5 'Flight/Destination' center; run;
To complete the job of enhancing headings in your list report, you can take advantage of two useful options in the PROC REPORT statement:
HEADLINE, which underlines all column headings and the spaces between them
HEADSKIP, which writes a blank line beneath all column headings or after the underline if the HEADLINE option is used.
These options have no effect on HTML output.
In this PROC REPORT step, the PROC REPORT statement specifies both HEADLINE and HEADSKIP.
proc report data=flights.europe nowd headline headskip;
where dest in ('LON','PAR'),
column flight orig dest mail freight revenue;
define revenue / format=dollar15.2;
define flight / width=6 'Flight/Number' center;
define orig / width=6 spacing=5 'Flight/Origin' center;
define dest / width=11 spacing=5 'Flight/Destination' center;
run;
In the SAS listing output, the column headings are underlined and are followed by a blank line.
So far, you've selected data for your list report and have defined column attributes and headings. Next, let's look at a more complex PROC REPORT feature: usage for variables in your report. You've seen that you define variable usage in the DEFINE statement. Now you can see how each usage affects the layout of your report and the values that the report contains.
PROC REPORT uses each variable in one of six ways (DISPLAY, ORDER, GROUP, ACROSS, ANALYSIS, or COMPUTED). By default, PROC REPORT uses
character variables as display variables
numeric variables as analysis variables, which are used to calculate the SUM statistic.
Because you haven't explicitly defined any variable usages, your current list report contains only display and analysis variables:
The character variables Flight, Orig, and Dest are display variables. Display variables don't affect the order of rows in the report. A report that contains one or more display variables has a detail row for each observation that is read from the data set. Each detail row contains a value for each display variable.
The numeric variables Mail, Freight, and Revenue are analysis variables. Analysis variables are used to calculate a statistic (in this case, the default SUM).
In the illustration below, columns for display variables are shown in white. Columns for analysis variables are shown in gray.
How you use a variable in a report determines, among other things, the order of the rows in your report. Let's see the effect of defining a variable as an order variable.
An order variable orders the detail rows in a report according to their formatted values. For example, suppose you want to see values in your list report ordered by flight number. To use Flight as an order variable, you specify the ORDER usage option in the DEFINE statement, as shown below.
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'), column flight orig dest mail freight revenue; define revenue / format=dollar15.2;
define flight / order 'Flight/Number' width=6 center;
define orig / width=6 spacing=5 'Flight/Origin' center;
define dest / width=11 spacing=5 'Flight/Destination' center;
run;
This is your ordered output. Notice that PROC REPORT displays only the first occurrence of each value of an order variable in a set of rows that have the same value for all order variables.
By default, the order is ascending, but you can change it with the DESCENDING option in the DEFINE statement:
proc report data=flights.europe nowd headline headskip;
where dest in ('LON','PAR'),
column flight orig dest mail freight revenue;
define revenue / format=dollar15.2;
define flight / order descending 'Flight/Number' width=6 center;
define orig / width=6 spacing=5 'Flight/Origin' center; define dest / width=11 spacing=5 'Flight/Destination' center; run;
Your list report is complete. But suppose you now want to create a summary report. That is, rather than a list of the mail, freight, and revenue for each flight, you want the total mail, freight, and revenue by flight number. Here is the summary report that you want to create:
To summarize your data using PROC REPORT, you can define one or more group variables. A group variable groups the detail rows in a report according to their formatted values. If a report contains one or more group variables, PROC REPORT consolidates into one row all observations from the data set that have a unique combination of values for all group variables.
To define a group variable, you specify the GROUP usage option in the DEFINE statement. Let's see how group variables affect your report.
If you submit the following PROC REPORT step, with Flight defined as a group variable, you get the output shown below.
proc report data=flights.europe nowd headline headskip;
where dest in ('LON','PAR'),
column flight orig dest mail freight revenue;
define revenue / format=dollar15.2;
define flight / group 'Flight/Number' width=6 center;
define orig / width=6 spacing=5 'Flight/Origin' center;
define dest / width=11 spacing=5 'Flight/Destination' center;
run;
But this output looks exactly like the list output in which Flight was an order variable. What happened?
The problem with the preceding output is that your report contains display variables. As character variables, Orig and Dest are defined as display variables by default.
All of the variables in a summary report must be defined as group, analysis, across, or computed variables. This is because PROC REPORT must be able to summarize all variables across an observation in order to collapse observations. If PROC REPORT can't create groups, it displays group variables as order variables.
To group data in your report, you need to define the character variables (Flight, Orig, and Dest) as group variables, as shown below:
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'),
column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / group 'Flight/Number' width=6 center; define orig / group width=6 spacing=5 'Flight/Origin' center; define dest / group width=11 spacing=5 'Flight/Destination' center; run;
Now PROC REPORT can create groups, and your summary report displays the total mail, freight, and revenue by flight number. Remember that the default statistic for the analysis variables is SUM.
The following table compares the effects of using order variables and group variables.
ORDER | GROUP | |
---|---|---|
Rows are ordered | yes | yes |
Repetitious printing of values is suppressed | yes | yes |
Rows that have the same values are collapsed | no | yes |
Type of report produced | list | summary |
As you saw in the previous example and practice, the default statistic for analysis variables is SUM. But you might want to display other statistics in your PROC REPORT output. To associate a statistic with an analysis variable, specify it as an attribute in the DEFINE statement.
Here's the previous sample output, which displays the default statistic SUM for the three analysis variables:
By specifying MEAN in the DEFINE statement for Revenue, you can display the average revenue for each flight number. The optional column heading Average Revenue clarifies that the MEAN statistic is displayed.
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'),
column flight orig dest mail freight revenue; define revenue / mean format=dollar15.2 'Average/Revenue'; define flight / group 'Flight/Number' width=6 center; define orig / group width=6 spacing=5 'Flight/Origin' center; define dest / group width=11 spacing=5 'Flight/Destination' center; run;
You can use the following statistics in PROC REPORT:
Statistic | Definition |
---|---|
CSS | Corrected sum of squares |
USS | Uncorrected sum of squares |
CV | Coefficient of variation |
MAX | Maximum value |
MEAN | Average |
MODE | Value that occurs most frequently (new in SAS 9.2) |
MIN | Minimum value |
N | Number of observations with nonmissing values |
NMISS | Number of observations with missing values |
RANGE | Range |
STD | Standard deviation |
STDERR | Standard error of the mean |
SUM | Sum |
SUMWGT | Sum of the Weight variable values |
PCTN | Percentage of a cell or row frequency to a total frequency |
PCTSUM | Percentage of a cell or row sum to a total sum |
VAR | Variance |
T | Student's t for testing the hypothesis that the population mean is 0 |
PRT | Probability of a greater absolute value of Student's t |
So far, we've looked at display, analysis, order, and group variables. You can also define variables as across variables, which are functionally similar to group variables. However, PROC REPORT displays the groups that it creates for an across variable horizontally rather than vertically.
Let's look at an example of across variables to clarify this usage.
The following program uses group variables to produce the output shown. The table shows unique combinations of values of the group variables, and sums of each analysis variable for each combination.
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'), column flight dest mail freight revenue; define revenue / format=dollar15.2; define flight / group 'Flight/Number' width=6 center; define dest / group width=11 spacing=5 'Flight/Destination' center; run;
Now let's suppose that you change the group variables to across variables, as in this program.
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'), column flight dest mail freight revenue; define revenue / format=dollar15.2; define flight / across 'Flight/Number' width=6 center; define dest / across width=11 spacing=5 'Flight/Destination' center; run;
In this case, for each across variable, the table cells contain a frequency count for each unique value. For each analysis variable, the table cells represent the sum of all the variable's values.
The last type of variable usage is reserved for computed variables, which are numeric or character variables that you define for the report. They are not in the input data set, and PROC REPORT doesn't add them to the input data set. You can't change the usage of a computed variable.
In the nonwindowing environment, you add a computed variable as follows:
Include the computed variable in the COLUMN statement.
Define the variable's usage as COMPUTED in the DEFINE statement.
Compute the value of the variable in a compute block that is associated with the variable.
Let's see how you create a new variable for your report.
Suppose you want to determine the number of empty seats for each flight. To do so, you can compute the variable EmptySeats by subtracting the number of passengers deplaning (Deplaned) from the plane's total number of seats (Capacity), assuming that the plane was full at the beginning of the flight.
In the following program, you
specify EmptySeats in the COLUMN statement to the right of the variables that are used in its calculation.
define EmptySeats as a computed variable in a DEFINE statement.
begin a compute block by specifying EmptySeats in a COMPUTE statement.
use DATA step statements in the compute block to calculate EmptySeats' value. Notice that when you refer to an analysis variable, you use a compound name that identifies both the original variable and the statistic that PROC REPORT now calculates from it. The compound name has the form variable-name.statistic.
close the compute block with an ENDCOMP statement.
proc report data=flights.europe nowd; where dest in ('LON','PAR'), column flight capacity deplaned emptyseats; define flight / width=6; define emptyseats / computed 'Empty Seats'; compute emptyseats; emptyseats=capacity.sum-deplaned.sum; endcomp; run;
The program creates the following output.
To create a default list report, you submit a basic PROC REPORT step. You can specify options to invoke the procedure in either windowing or nonwindowing mode. By default, all observations and variables in the data set are printed, and variables appear in the order in which they occur in the data set.
To select and order the variables that appear in your list report, you can use the COLUMN statement.
To select rows for your report, you can use the WHERE statement as you do with many other SAS procedures.
You can enhance your report by defining how each variable is used in the report. To describe how to use and display variables in your report, you use one or more DEFINE statements.
To assign a format to a specific report column, use the FORMAT= attribute in the DEFINE statement for that column. To specify a width for columns in your report, use the WIDTH= attribute in the DEFINE statement. To specify a different column spacing, use the SPACING= attribute in the DEFINE statement. To define a column heading, specify the heading text in quotation marks in the DEFINE statement. To control how words break in column headings, you can use a split character in the column label. For each variable that you define, you can specify the justification option CENTER, LEFT, or RIGHT in the DEFINE statement.
To enhance headings in your report, you can use the HEADLINE option, which underlines all column headings and the spaces between them, and the HEADSKIP option, which writes a blank line before the data values. These options have no effect on HTML output.
PROC REPORT uses each variable in one of six ways (DISPLAY, ORDER, GROUP, ACROSS, ANALYSIS, or COMPUTED). By default, PROC REPORT uses character variables as display variables, and it uses numeric variables as analysis variables, which are used to calculate the SUM statistic. You can define usage for variables in the DEFINE statement.
Variable Usage in PROC REPORT | |
---|---|
Display variables | do not affect the order of rows in the report. A report that contains one or more display variables has a detail row for each observation in the data set. Each detail row contains a value for each display variable. By default, PROC REPORT treats all character variables as display variables. |
Order variables | order the detail rows in a report according to their formatted values. |
Group variables | order the detail rows in a report according to their formatted values. If a report contains one or more group variables, PROC REPORT tries to consolidate into one row all observations from the data set that have a unique combination of values for all group variables. |
Across variables | are functionally similar to group variables; however, PROC REPORT displays the groups that it creates for an across variable horizontally rather than vertically. |
Analysis variables | are used to calculate a statistic. By default, PROC REPORT uses numeric variables as analysis variables, which are used to calculate the SUM statistic. |
Computed variables | are variables that you define for the report. They are not in the data set. You cannot change the usage of a computed variable. Computed variables can be either numeric or character variables. |
PROC REPORT < DATA=SAS-data-set> <options>;
COLUMN variable(s);
DEFINE variable /< usage> <attributes(s)><option(s)>
<justification> <'column-heading'>;
COMPUTE computed-variable;
DATA step statements;
ENDCOMP;
RUN;
proc report data=clinic.diabetes nowd; column sex weight fastgluc postgluc glucrange; where age>40; define weight / format=comma6.2 spacing=4 'Average/Weight' width=7; define sex / order width=7 spacing=4 center 'Sex of/Patient'; define fastgluc / 'Fasting/Glucose'; define postgluc / 'Postprandial/Glucose' width=12; define glucrange / computed 'Glucose/Range'; compute glucrange; glucrange=postgluc.sum-fastgluc.sum; endcomp; run;
You can use PROC REPORT in either windowing or nonwindowing mode.
You can use FORMAT statements with PROC REPORT, but the DEFINE statement enables you to specify more than one column attribute at a time.
For HTML output, the FORMAT= option cannot increase cell width beyond the width of cell values. The WIDTH= and SPACING= attributes, along with the HEADSKIP and HEADLINE options, have no effect on HTML output.
You can use the default slash as the split character, or you can specify a split character using the SPLIT= option in the PROC REPORT statement.
By default, PROC REPORT uses character variables as display variables and numeric variables as analysis variables, which are used to calculate the SUM statistic.
All of the variables in a summary report must be defined as group, analysis, across, or computed variables. If PROC REPORT can't create groups, it displays group variables as order variables.
You can't change the usage of a computed variable.
The position of a computed variable is important. You can't base the calculation of a computed variable on any variable that appears to its right in the report.
Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
If Style has four unique values and you submit the following program, which output do you get? (Assume that all the other variables are numeric.)
proc report data=sasuser.houses nowd; column style sqfeet bedrooms price; define style / group; run;
When you define an order variable,
the detail rows are ordered according to their formatted values.
you can't create summary reports.
PROC REPORT displays only the first occurrence of each order variable value in a set of rows that have the same value for all order variables.
all of the above
Which attributes or options are reflected in this PROC REPORT output?
SKIPLINE and FORMAT=
CENTER, HEADLINE, HEADSKIP, and either WIDTH=, SPACING=, or FORMAT=
SPACING= only
CENTER, FORMAT=, and HEADLINE
To create a summary report that shows the average number of bedrooms and the maximum number of baths for each style of house, which DEFINE statements do you use in your PROC REPORT step?
define style / center 'Style of/House'; define bedrooms / mean 'Average/Bedrooms'; define baths / max 'Maximum/Baths';
define style / group; define bedrooms / mean 'Average/Bedrooms'; define baths / max 'Maximum/Baths';
define style / order; define bedrooms / mean 'Average/Bedrooms'; define baths / max 'Maximum/Baths';
define style / group; define bedrooms / 'Average/Bedrooms'; define baths / 'Maximum/Baths'
Which program does not contain an error?
proc report data=sasuser.houses nowd; column style bedrooms baths; define style / order; define bedbathratio / computed format=4.2; compute bedbathratio; bedbathratio=baths.sum/bedrooms.sum; endcomp; run;
proc report data=sasuser.houses nowd; column style bedrooms baths BedBathRatio; define style / order; define bedbathratio / order format=4.2; compute bedbathratio; bedbathratio=baths.sum/bedrooms.sum; endcomp; run;
proc report data=sasuser.houses nowd; column style bedrooms baths BedBathRatio; define style / order; define bedbathratio / computed format=4.2; compute bedbathratio; bedbathratio=baths.sum/bedrooms.sum; endcomp; run;
proc report data=sasuser.houses nowd; column style bedrooms baths BedBathRatio; define style / order; define bedbathratio / computed format=4.2; compute bedbathratio; bedbathratio=baths/bedrooms; endcomp; run;
What output does this PROC REPORT step produce?
proc report data=sasuser.houses nowd; column style sqfeet bedrooms price; run;
a list report ordered by values of the first variable in the COLUMN statement
a summary report ordered by values of the first variable in the COLUMN statement
a list report that displays a row for each observation in the input data set and which calculates the SUM statistic for numeric variables
a list report that calculates the N (frequency) statistic for character variables
Which of the following programs produces this output?
proc report data=sasuser.houses nowd; column style condo range split twostory price; define price / mean 'Average Price'; run;
proc report data=sasuser.houses nowd; column style price; define style / group; define price / mean 'Average Price'; run;
proc report data=sasuser.houses nowd; column style price; define style / across; define price / mean 'Average Price'; run;
proc report data=sasuser.houses nowd; column style price; define style / across 'CONDO' 'RANCH' 'SPLIT' 'TWOSTORY'; define price / mean 'Average Price'; run;
If you submit this program, where does your PROC REPORT output appear?
proc report data=sasuser.houses nowd; column style sqfeet bedrooms price; define style / group; run;
in the PROC REPORT window
as HTML and/or SAS listing output
both of the above
neither of the above
How can you create output with headings that break as shown below?
You must specify the SPLIT= option in the PROC REPORT statement and use the split character in column headings in DEFINE statements.
You must use the default split character in column headings in DEFINE statements.
You must specify either the WIDTH= or the SPACING= attribute in DEFINE statements.
These headings split this way by default.
Suppose you want to create a report using both character and numeric variables. If you don't use any DEFINE statements in your PROC REPORT step,
your PROC REPORT step will not execute successfully.
you can produce only list reports.
you can order rows by specifying options in the PROC REPORT statement.
you can produce only summary reports.