If you specify the MISSING option in a CLASS statement, PROC TABULATE
considers missing values as valid levels for the class variable(s) that are specified in that
CLASS statement:
proc tabulate data=year_sales format=comma10.;
class SalesRep;
class Month Quarter / missing;
var AmountSold;
Because the MISSING option is in the second CLASS statement, observations with
missing values for Month or Quarter are displayed in the summary table, but
observations with a missing value for SalesRep are not displayed.
If you have class variables with missing values in your data set, then you must decide
whether the observations with the missing values should be omitted from every table. If
the observations should not be omitted, then you can fill in the missing values where
appropriate or continue to run the PROC TABULATE step with the MISSING option.
For other options for handling missing values, see “Handling Missing Data” in PROC
TABULATE by Example. For general information about missing values, see “Missing
Values” in SAS Language Reference: Concepts.
Input File and SAS Data Set for Examples
The examples in this section use one input file and one SAS data set. For more
information, see “The YEAR_SALES Data Set” on page 816.
The input file contains sales records for a company, TruBlend Coffee Makers, that
distributes the coffee machines. The file has the following structure:
01 1 Hollingsworth Deluxe 260 49.50
01 1 Garcia Standard 41 30.97
01 1 Hollingsworth Deluxe 330 49.50
01 1 Jensen Standard 1110 30.97
01 1 Garcia Standard 715 30.97
01 1 Jensen Deluxe 675 49.50
02 1 Jensen Standard 45 30.97
02 1 Garcia Deluxe 10 49.50
more data lines
12 4 Hollingsworth Deluxe 125 49.50
12 4 Jensen Standard 1254 30.97
12 4 Hollingsworth Deluxe 175 49.50
The input file contains the following data from left to right:
the month in which a sale was made
the quarter of the year in which a sale was made
the name of the sales representative
the type of coffee maker sold (standard or deluxe)
the number of units sold
the price of each unit in US dollars
Input File and SAS Data Set for Examples 479

Get Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.