PROC FREQ Statement
- PROC FREQ < options > ;
The PROC FREQ statement invokes the procedure.
The following table
lists the options available in the PROC FREQ statement. Descriptions
follow in alphabetical order.
Table 26.4: PROC FREQ Statement Options
|
Option
|
Description
|
| DATA= | specifies the input data set. |
| COMPRESS | begins the next one-way table on the current page even if the entire
table does not fit on that page. |
| FORMCHAR= | specifies the outline and cell divider characters for the
cells of the crosstabulation table. |
| NOPRINT | suppresses all displayed output. |
| ORDER= | specifies the order to list the variable values. |
| PAGE | displays one table per page. |
You can specify the following options in the PROC FREQ statement.
-
COMPRESS
-
begins display of the next one-way frequency table on the same page as the
preceding one-way table if there is enough space to begin the table. By
default, the next one-way table begins on the current page only if the entire
table fits on that page. The COMPRESS option is not valid with the
PAGE option.
-
DATA=SAS-data-set
-
names the SAS data set to be analyzed by PROC FREQ.
If you omit the DATA= option, the procedure uses
the most recently created SAS data set.
-
FORMCHAR (1,2,7) ='formchar-string'
-
defines the characters to be used for constructing the
outlines and dividers for the cells of contingency tables.
The FORMCHAR= option can specify 20 different SAS formatting
characters used to display output; however, PROC FREQ uses only
the first, second, and seventh formatting characters. Therefore,
the proper specification for PROC FREQ is FORMCHAR(1,2,7)=
'formchar-string'.
The formchar-string should be three characters long.
The characters are used to denote (1) vertical separator,
(2) horizontal separator, and (7) vertical-horizontal intersection.
You can use any character in formchar-string, including
hexadecimal characters. If you use hexadecimal
characters, you must put an x after the closing quote.
For information on which hexadecimal codes to use for which characters,
consult the documentation for your hardware.
Specifying all blanks for formchar-string produces tables
with no outlines or dividers:
formchar (1,2,7)=' '
If you do not specify the FORMCHAR=
option, PROC FREQ uses the default
formchar(1,2,7)='|-+'
Refer to the CALENDAR, PLOT, and TABULATE procedures in
the SAS Procedures Guide for more information on
form characters.
Table 26.5: Formatting Characters Used by PROC FREQ
|
Position
|
Default
|
Used to Draw
|
| 1 | | | vertical separators |
| 2 | - | horizontal separators |
| 7 | + | intersections of vertical and horizontal separators |
-
NOPRINT
-
suppresses the display of all output. Note that this
option temporarily disables the Output Delivery System (ODS).
For more information, see Chapter 14, "Using the Output Delivery System."
Note: A NOPRINT option is also
available in the TABLES statement.
It suppresses display of the crosstabulation tables but allows
display of the requested statistics.
-
ORDER=DATA | FORMATTED | FREQ | INTERNAL
-
specifies the order in which the values of the frequency and crosstabulation
table variables are to be reported. The following table shows how PROC FREQ
interprets values of the ORDER= option.
- DATA
- orders values according to their order in the input
data set.
- FORMATTED
- orders values by their formatted values. This order
is operating environment dependent. By default,
the order is ascending.
- FREQ
- orders values by descending frequency count.
- INTERNAL
- orders values by their unformatted values, which yields
the same order that the SORT procedure does. This order
is operating environment dependent.
By default, ORDER=INTERNAL. The ORDER= option does not apply to
missing values, which are always ordered first.
-
PAGE
-
displays only one table per page.
Otherwise, PROC FREQ displays multiple tables per page as space permits.
The PAGE option is not valid with the COMPRESS option.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.