SPSS: Reading data from an external file.

Example for UNIX

The name of the command file for this example is

	income.spss  
It shows how to read data from an external data file and produce descriptive statistics. The name of the data file is

	income.data
It resides in your current directory.


beginning of sample command file
set width=80 highres=off

* Read data, set missing values for persinc
data list free file='income.data' / gender race persinc
missing values persinc (99)

* Produce descriptive statistics
descriptives var=all
end of sample command file
To run the program type

	% spss -m < income.spss >! income.lst
NOTE: Be sure you DO NOT use the same name for the command file (here income.spss) that you use for the output (here income.lst).

For this example, the results are written to the file

	income.lst

For this example, the input file, income.data is
    1 1 20
    1 1 99
    1 1 13
    2 1  1
    1 1 10
    2 2  5
    2 1 12
    1 1  7
    2 1 99
    2 2  2

University of Delaware
June 19, 1994