Previous Page | Next Page

Modifying SAS Data Sets

Input SAS Data Set for Examples

In this section you will look at examples from an inventory tracking system that is used by a tool vendor. The examples use the SAS data set INVENTORY as input. The data set contains these variables:

PartNumber

is a character variable that contains a unique value that identifies each item.

Description

is a character variable that contains the text description of each item.

InStock

is a numeric variable that contains a value that describes how many units of each tool the warehouse has in stock.

ReceivedDate

is a numeric variable that contains the SAS date value that is the day for which InStock values are current.

Price

is a numeric variable that contains the price of each item.

The following program creates and displays the INVENTORY data set:

options pagesize=60 linesize=80 pageno=1 nodate;

data inventory;
   input PartNumber $ Description $ InStock @17 
         ReceivedDate date9. @27 Price;
   format ReceivedDate date9.;
   datalines;
K89R seal   34  27jul1998 245.00
M4J7 sander 98  20jun1998 45.88
LK43 filter 121 19may1999 10.99
MN21 brace 43   10aug1999 27.87
BC85 clamp 80   16aug1999 9.55
NCF3 valve 198  20mar1999 24.50
KJ66 cutter 6   18jun1999 19.77
UYN7 rod  211   09sep1999 11.55
JD03 switch 383 09jan2000 13.99
BV1E timer 26   03aug2000 34.50
;

proc print data=inventory;
   title 'Tool Warehouse Inventory';
run;

The following output shows the results:

The INVENTORY Data Set

                            Tool Warehouse Inventory                           1

                  Part                      In      Received
          Obs    Number    Description    Stock         Date     Price

            1     K89R       seal           34     27JUL1998    245.00
            2     M4J7       sander         98     20JUN1998     45.88
            3     LK43       filter        121     19MAY1999     10.99
            4     MN21       brace          43     10AUG1999     27.87
            5     BC85       clamp          80     16AUG1999      9.55
            6     NCF3       valve         198     20MAR1999     24.50
            7     KJ66       cutter          6     18JUN1999     19.77
            8     UYN7       rod           211     09SEP1999     11.55
            9     JD03       switch        383     09JAN2000     13.99
           10     BV1E       timer          26     03AUG2000     34.50

Previous Page | Next Page | Top of Page