SPSS On-Line Training Workshop

 

Link to Table of Contents

In this Tutorial: 

Syntax Editor
Window

Running
the command

Journal File

 

When we use the main frame, we need to write an SPSS program and run the program just like a batch job. We obtain computer output. We then check if the results are what we need. If something is not done properly, we change the SPSS program and re-submit the job again until we obtain the results we need. In the SPSS/PC, you can do the same thing with much less hustle. This is done by using the SYNTAX EDITOR window to obtain an SPSS Program.

When do you need to create an SPSS program in a PC environment?

All of the process you need from data entry, data manipulation, data analysis to output results can be done using Pull-Down menus as demonstrated in previous movie clips. However, if you need to conduct the same analysis more than one time, you may find SPSS Program very handy. This allows you to run the same program as many times as needed. It also allows you to make minor changes for various analysis and then rerun the program.

Click on the following movie clip:

camera.gif (1166 bytes) MOVIE:  Syntax Editor and Journal Files camera.gif (1166 bytes)

In this on-line workshop, you will find many movie clips. Each movie clip will demonstrate some specific usage of SPSS.

Creating an SPSS program using the Syntax Editor Window

The Syntax Editor window does not exist until you create an SPSS program. There are several ways to create an SPSS program in the SPSS/PC environment.

bullet Create SPSS program command lines when using the Pull-Down menu.
bulletFor an example, you want to perform a crosstab analysis. You go to the "Analyze" Menu, go down to "Descriptives" and select "Crosstab". A dialog box appears for you to enter the necessary information. On the right, top corner inside the dialog box, you see a button "Paste". This button translates your instruction from the dialog box into SPSS command lines.
bulletAfter you complete the dialog instruction, if you click on the "OK" button, then, these instructions are performed right away.
bulletHowever, if you click on the "Paste" button, the SPSS system will translate these instructions into SPSS command lines and store them in the Syntax Editor Window. At this time, the Syntax Editor Window is created. The instructions you entered into the dialog box are NOT performed. They are now in the Syntax Editor Window waiting for you to edit or to run.
bullet Create SPSS program command lines by creating a new syntax editor window, and key in an SPSS program.
bulletTo do this, go to the File Menu, go down to "New", and select "Syntax".  A new Syntax editor window is now created. You can enter your own SPSS program.
bullet To run an existing SPSS program which is not created using SPSS/PC.
bulletYou may have an old SPSS program that was created using the main frame or some other way. You have the source code, now you would like to run the program using SPSS/PC.
bulletOpen your SPSS program as a PC word processing file or a text file.
bulletCreate a new Syntax Editor window by selecting "File",  "New" and then, "Syntax".
bulletCopy your SPSS program statements and paste them into the new syntax editor window. Now you have your old SPSS program in the syntax editor. You are ready to run this program (assuming you also have your data set read into the Data Editor Window).
bulletYou  have completed all the data entry, data manipulation, data analysis and output results. Before you exit from the SPSS system, you feel like keeping a copy of all the SPSS commands that you have conducted, but you did not select "Paste" when you performed the activities. Are these SPSS commands still available?
bulletYES, these commands are always recorded in a file called "Journal".  This file contains all of the activities that you conducted since you started to run this current SPSS session. Click on Journal File to learn more about this file.
bulletThis file is located at \Windows\TEMP\SPSS.jnl. Go to your hard drive (usually the c-drive), open Windows folder, then open TEMP folder and find this SPSS file.  Open this file using any text editor such as Notepad or MS Words.
bulletCopy the part of the SPSS command lines and paste them into the Syntax Editor Window.

Running the SPSS commands in the Syntax Editor window

Syntax.jpg (47595 bytes)

Once you have created any SPSS command lines in the Syntax Editor window, you can run ALL of the commands or run a selection of commands at any time.

bullet

To run all of the commands in the window: Go to the menu "Run" on the top of the Syntax window, choose "ALL" to run all commands. The results will appear in the Output Editor Window.

bullet

To run only part of the commands: First highlight the commands you wish to run, then go to the "Run" Menu, choose "Selection". The results will appear in the Output Window.

Creating a Journal File

This Journal, by default, is a file that appends all of your SPSS activities since you use the SPSS/PC at the first time. This means that after a time period, this file may grow too large that it will occupy a large space in your hard drive.

In order to record ONLY the activities of the current session, you need to change an OPTION under the Edit Menu.  (For information on the edit options, click below:)

Getting Started Clip click here to watch:  Options

bullet

Go to the Edit Menu, go down to "Options" to edit the Options for running SPSS program.

bullet

The dialog box shows the "General" options, by default. Change the "Session Journal" from "Append" to  "Overwrite". Click  on "OK".
Note:  You may simply use the default option for the Journal File using "Append" option if the hard disk space is not a problem.

Where to locate the Journal File?

This file is located at \windows\temp\spss.jnl. Go to your hard drive (usually c-drive), open the "windows" folder, open the "TEMP" folder inside the Windows, to locate the file "spss.jnl". You can edit this file at any time you wish.

 

Navigation for Home,  Tutorials and Contact Us

©1999 Dr Carl Lee, Dr Felix Famoye, Central Michigan  University.  Joyce Sharp, student assistant.  All rights reserved.