** UNIX INSTRUCTIONS FOR RUNNING SPSS PROGRAMS NON-INTERACTIVELY **

1. Log on to SOLIX.

2. To create a new file, use the pico command. This is a similar editor to pine used in the mail system.

Be careful to use lower case letters since UNIX is case-sensitive.
Note that the % sign is the default UNIX prompt.
% pico freq.sps
(Note: ALWAYS use .SPS as the extension for your SPSS programs so they are easy to find).
This command should put you into a blank screen where you can begin typing your SPSS commands.
-------------------------------------------------------------------------------------------------------------------------------
| data list file='students.dat' list                             <----- Note if your program is in your home directory and your data file
|         / idno credits job gpa.                                          students.dat is in a subdirectory called projects, specify its location
| value labels job 1 'yes' 2 'no'.                                        in UNIX format, e.g., file = '~/projects/students.dat'
| title 'Listing of all the variables'.
| list variables = idno to gpa.
| title 'Frequency tables for variables'.
| frequencies variables = credits job gpa
|         /statistics.
| finish.
-----------------------------------------------------------------------------------------------------------------------------
Simply begin typing the SPSS commands. Remember to start commands in column 1. Subcommands should be indented. You can use the arrow keys to move around and pico commands are on the bottom of the screen to help you. When you are done, exit as by holding down the control key and hit X (^X). Pico will ask if you want to "save the modified buffer", say Y for yes and it will ask if the "File name to write to" is freq.sps. If so, just hit return. The computer will tell you how many lines were written.
3. To run the SPSS program, type
% spss -m freq.sps > freq.lst This will tell SPSS not to use the manager and to send the
output to a file named freq.lst
4. When the program is done running, the % prompt will appear. The directory command ls will show a new file, freq.lst. This file contains the results from the SPSS procedures. You need to check the file to make sure the procedures ran correctly and there are no error messages. Note the * is a "wildcard" so that any file beginning with freq. will be listed.
% ls freq.*

freq.lst freq.sps

5. Check the .lst file with pico or more for errors.
% more freq.lst or % pico freq.lst

(If you use the pico command, be sure to say N to "save modified buffer changes" if it appears and not Y so that the .lst file is not inadvertently changed.)

If there are errors you must edit the .sps file (% pico freq.sps) and make the necessary changes, then rerun the program(% spss -m freq.sps > freq.lst ) and check the new .lst file for errors.

If there are no errors, print the file either in the lab room you are in or in PC436, where it will be filed for later pickup under your username. For example--

% lpr -P ipc413 freq.lst

or print the 2 files (freq.sps and freq.lst) using the *

% lpr -P ipc413 freq.*

6. Because you have limited space on the computer, at some point you will probably need to delete your .lst files.
% rm freq.lst

BUT be sure to save the .sps files since you can always rerun them if necessary. BE VERY CAREFUL using the * when deleting files. Once a file is deleted, it is gone. If you are using rm with a wildcard specification, it is a good idea to test it first with an ls command to see what files are matched.

You can also copy a SPSS command file to a new one and edit the new program for other analyses.

% cp -i freq.sps newprog.sps The -i will tell you if there is already a file called newprog.sps and do you want to write over it.

7. To terminate the session, logoff the computer.
% logout

WWW.SPSS.COM

Back To Statistical Consulting
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

.                                                                            .                                                                                 .