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.

6 Universals<br />

You should observe interactive rules when you:<br />

• Submit commands from a syntax window or with an SPSS Manager, either one command<br />

at a time or as a group.<br />

• Enter commands at a command prompt on those systems that run prompted sessions.<br />

See the SPSS Base User’s Guide for your version of SPSS for more information.<br />

Batch (Production) Mode<br />

The following rules apply to command specifications in batch or production mode:<br />

• All commands in the command file must begin in column 1. You can use plus (+) or<br />

minus (−) signs in the first column if you want to indent the command specification to<br />

make the command file more readable.<br />

• If multiple lines are used for a command, column 1 of each continuation line must be<br />

blank.<br />

• <strong>Command</strong> terminators are optional.<br />

• An asterisk (*) in the first column indicates a comment line (see the COMMENT command).<br />

You should observe batch rules when you:<br />

• Construct a command file for use with the Production Facility.<br />

• Construct a command file that will be submitted to your operating system for execution.<br />

• Construct a command file that will be included using the INCLUDE command. You can<br />

include a command file when you are working in interactive mode. The included command<br />

file, however, must follow batch rules.<br />

The way you submit a command file for execution varies from operating system to operating<br />

system. <strong>Command</strong> files do not necessarily need to be submitted to a batch queue, although they<br />

can be on operating systems that have a batch queue. In batch mode, the commands in the file<br />

are executed one after the other, and output is displayed when all commands are executed.<br />

The following is a sample command file:<br />

GET FILE=BANK.SAV /KEEP ID TIME SEX JOBCAT SALBEG SALNOW<br />

/RENAME SALNOW = SAL90.<br />

DO IF TIME LT 82.<br />

+ COMPUTE RATE=0.05.<br />

ELSE.<br />

+ COMPUTE RATE=0.04.<br />

END IF.<br />

COMPUTE SALNOW=(1+RATE)*SAL90.<br />

EXAMINE VARIABLES=SALNOW BY SEX /PLOT=NONE.<br />

Subcommands<br />

Many commands include additional specifications called subcommands for locating data,<br />

handling data, and formatting the output.

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

Saved successfully!

Ooh no, something went wrong!