Chapter 14. The Command Syntax Language

In This Chapter

  • Understanding the fundamental form of Syntax commands

  • Controlling the flow of execution through a program

  • Reading and writing files with Syntax

Everything that happens in SPSS is the result of executing a Command Syntax script. Whenever you use the menu to specify a set of options and then click an OK button that instructs SPSS to perform some feat, a Command Syntax script is generated and executed. You've seen examples of the Command Syntax language — Syntax for short — appearing at the top of the SPSS Viewer every time a command runs. This chapter describes some language fundamentals, and the next one explains how you can write your own programs. These two chapters give you a look at the operation of the Syntax language.

Commands

A single Syntax language instruction can be very simple, or it can be complex enough to serve as an entire program. A single instruction consists of a command followed by arguments to modify or expand the actions of the command. For example, the following Syntax command generates a report:

REPORT /FORMAT=LIST /VARIABLES=MPG.

The first thing you probably noticed is that the command is written in all uppercase. That's tradition — not a requirement. You can write in lowercase (or even mixed case) if you want. Notice also that the end of the list of arguments is terminated by a single period. The terminator must be there or SPSS will complain.

Now, about those forward slashes and equal signs: Sometimes you need ...

Get SPSS For Dummies®, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.