27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Files<br />

SPSS reads, creates, and writes different types of files. This section provides an overview<br />

of the types of files used in SPSS and discusses concepts and rules that apply to all files.<br />

Conventions for naming, printing, deleting, or permanently saving files, and for submitting<br />

command files for processing, differ from one computer and operating system to another.<br />

For specific information, consult the SPSS Base User’s Guide for your version of SPSS.<br />

<strong>Command</strong> File<br />

<strong>Command</strong> files contain commands, sometimes with inline data. They can be created by a<br />

text editor. Wherever SPSS allows you to paste commands, either in a syntax window or<br />

with an SPSS manager, the resulting file is a command file. You can also edit a journal file<br />

to produce a command file (see “Journal File” below). The following is an example of a<br />

simple command file that contains both commands and inline data:<br />

DATA LIST /ID 1-3 SEX 4 (A) AGE 5-6 OPINION1 TO OPINION5 7-11.<br />

BEGIN DATA<br />

001F2621221<br />

002M5611122<br />

003F3422212<br />

329M2121212<br />

END DATA.<br />

LIST.<br />

• Case does not matter for commands but is significant for inline data. If you specified f<br />

for female and m for male in column 4 of the data line, the value of SEX would be f or<br />

m, instead of F or M as it is now.<br />

• <strong>Command</strong>s can be in upper or lower case. Uppercase characters are used for all commands<br />

throughout this manual only to distinguish them from other text.<br />

Journal File<br />

SPSS keeps a journal file to record all commands either entered in the syntax window or<br />

generated from a dialog box during a session. You can retrieve this file with any text editor<br />

and review it to learn how the session went. You can also edit the file to build a new<br />

command file and use it in another run. An edited and tested journal file can be saved and<br />

used later for repeated tasks. The journal file also records any error or warning messages<br />

generated by commands. You can rerun these commands after making corrections and<br />

removing the messages.<br />

The default name for the journal file is SPSS.JNL on most operating systems. You can<br />

turn off the journal or assign a different name to it (see SET). SPSS erases an existing<br />

journal file with the default name when it starts a new session. If you want to save a journal<br />

file for future use, rename it before you start another session. On some operating systems,<br />

SPSS allows you to overwrite or append to journals from a previous session. Consult the<br />

SPSS Base User’s Guide for your version of SPSS for specific information. Figure 2 is a<br />

journal file for a short session with a warning message.<br />

11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!