The examples in this section use one input file and
one SAS data set.
For more information,
see The YEAR_SALES Data Set.
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 price of each unit in US dollars
The SAS data set is
named YEAR_SALES. This data set contains all the sales data from the
input file and data from a new variable named AmountSold, which is
created by multiplying Units by Price.
The following program
creates the SAS data set that is used in this section:
data year_sales;
infile 'your-input-file';
input Month $ Quarter $ SalesRep $14. Type $ Units Price;
AmountSold = Units * Price;
run;