Chapter 15. Command Syntax Language Examples

In This Chapter

  • Writing a Syntax program and saving it to disk

  • Modifying the menus to run Syntax programs

  • Understanding some useful Syntax commands

Most Syntax Command programs are short. That's because one command can do so much. This chapter is about the mechanics of writing and running Syntax programs. If you plan to do much processing with SPSS, you'll certainly be doing some things over and over. If you save those procedures in a Syntax command program, you can just run the program instead of stepping through the process again.

Writing a Syntax Command Program

To write a new Syntax program, do the following:

  1. From the main menu, choose File

    Writing a Syntax Command Program
    New
    Writing a Syntax Command Program
    Syntax
    .

    The SPSS Syntax Editor dialog box appears, as shown in Figure 15-1. Use the text area in the upper right of the dialog box to enter the text in the Syntax language. Below the text area is a panel for displaying errors. (The error panel can be resized by dragging the bar at its top.) The panel to the left displays a synopsis of the commands in the program.

  2. Enter the text of the Syntax language in the upper-right panel.

    The lines are numbered automatically and can be as long as you need them to be — the window will scroll as necessary.

  3. To execute the program after you write it, choose RunAll.

Figure 15.1. This ...

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.