SPSS on UNIX
SPSS for Unix allows the interactive execution of SPSS programs from the Unix environment. Access to SPSS requires a Unix (network) ID on the computational server (FATMAN.SIU.EDU) and knowledge of SPSS commands and syntax. (Unix access for a Network ID can be obtained on the web.) The following paragraphs describe how to execute SPSS via batch commands and via an interactive SPSS window.
Batch Execution
To run an SPSS program under the Unix batch environment, create a file containing SPSS commands using a Unix editor (e.g., VI, Emacs, XC, or XE). The SPSS program file typically has the file extension SPS (e.g., SAMPLE.SPS). A sample program follows:
TITLE 'SAMPLE PROGRAM ON SPSS' DATA LIST /NAME 1-15 (A) SEX 17 (A) AGE 20-21 DEPT 24-25 GPA 28-31 (2) SCORE1 34-36 SCORE2 39-41 SCORE3 44-46 LIST CASES = FROM 1 TO 4 BY 2 BEGIN DATA ELIZABETH F 20 2 3.25 82 93 89 LISA F 23 4 3.84 92 100 96 MICHAEL M 22 3 3.46 85 89 91 DAVID M 19 1 2.76 69 77 85 END DATA VALUE LABELS SEX 'F' 'FEMALE' 'M' 'MALE' COMPUTE AVESCORE = MEAN.3 (SCORE1 TO SCORE3) VARIABLE LABELS AVESCORE 'AVERAGE SCORE' STRING GRADE (A1) RECODE AVESCORE (LO THRU 59 = 'F') (60 THRU 69 = 'D') (70 THRU 79 = 'C') (80 THRU 89 = 'B') (90 THRU HI = 'A') INTO GRADE FREQUENCIES VARIABLES = GRADE FINISH
Executing SPSS Via Batch
To execute an SPSS program interactively via the Unix batch environment, issue the command
spss -m filename1 > filename2
where "filename1" is the filename of the SPSS program file and "filename2" is the name of the file to contain the program output.. For example, if the file SAMPLE.SPS is to be executed and the output is to be located in SAMPLE.LST, issue the command
spss -m sample.sps > sample.lst
Executing SPSS Via Interactive Commands
To execute an SPSS program interactively via on-line commands that are saved in an SPSS journal, issue the following command from the Unix $ prompt:
spss -m
An SPSS prompt will appear. Enter the needed SPSS commands at the prompt. Each command is executed after the ENTER key is pressed. If commands are entered incorrectly, they can be re-entered immediately. To terminate the SPSS session, type
finish
at the SPSS command prompt. You'll automatically be returned to the Unix command prompt.
Executing SPSS Interactively Via a Multi-window Session
SPSS on Unix can also be executed from a multi-window session similar to SPSS/PC+. From the Unix $ prompt, type
spss +m
to begin the session. Within this environment, there are numerous hot keys that are helpful when moving between windows or performing specific functions. Some of the common ones are:
ESC-1 help/info ESC-e edit ESC-m menu list ESC-o exit
Additional Information
External data files can be referenced directly on the DATA LIST statement using the FILE parameter:
TITLE 'SAMPLE PROGRAM ON SPSS' DATA LIST FILE='survey.data' /NAME 1-15 (A) SEX 17 (A) AGE 20-21 DEPT 24-25 GPA 28-31 (2) SCORE1 34-36 SCORE2 39-41 SCORE3 44-46 LIST CASES = FROM 1 TO 4 BY 2 VALUE LABELS SEX 'F' 'FEMALE' 'M' 'MALE' COMPUTE AVESCORE = MEAN.3 (SCORE1 TO SCORE3) VARIABLE LABELS AVESCORE 'AVERAGE SCORE' STRING GRADE (A1) RECODE AVESCORE (LO THRU 59 = 'F') (60 THRU 69 = 'D') (70 THRU 79 = 'C') (80 THRU 89 = 'B') (90 THRU HI = 'A') INTO GRADE FREQUENCIES VARIABLES = GRADE FINISH
Customers should remember, however, that Unix file names are case-sensitive. If your external data file has a lowercase name, you must provide the lowercase name within the SPSS program.
References
SPSS 6.1 Syntax Reference Guide. SPSS Inc. 1994. (ISBN 0-13-438250-1; $38.00)SPSS 6.1 Base System User's Guide, Part 1 Unix Version. SPSS Inc. 1995. (ISBN 0-13-459561-0; $21.00)
SPSS 6.1 Base System User's Guide, Part 2. SPSS Inc. 1994. (ISBN 0-13-438870-4; $28.00)
SPSS Advanced Statistics 6.1. SPSS Inc. 1994. (ISBN 0-13-200065-2; $38.00)
SPSS Professional Statistics 6.1. SPSS Inc. 1994. (ISBN 0-13-190125-7; $36.00)
SPSS Categories 6.1. SPSS Inc. 1994. (ISBN 0-13-182320-5; $28.00)
SPSS Tables 6.1. SPSS Inc. 1994. (ISBN 0-13-2000834-3; $28.00)
SPSS Trends 6.1. SPSS Inc. 1994. (ISBN 0-13-201055-0; $28.00)
SPSS for the IBM RS/6000 User Code, Release 5.0. SPSS Inc. 1993. (ISBN 1-56827-122-0; $38.00)
The above manuals can be purchased from Prentice Hall:
Prentice Hall
Telephone: 1-800-374-1200

