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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXECUTE<br />

EXECUTE<br />

Overview<br />

EXECUTE forces the data to be read and executes the transformations that precede it in the<br />

command sequence.<br />

Basic Specification<br />

The basic specification is simply the command keyword. EXECUTE has no additional<br />

specifications.<br />

Operations<br />

Example<br />

• EXECUTE causes the data to be read but has no other influence on the session.<br />

• EXECUTE is designed for use with transformation commands and facilities such as ADD<br />

FILES, MATCH FILES, UPDATE, PRINT, and WRITE, which do not read data and are not<br />

executed unless followed by a data-reading procedure.<br />

DATA LIST FILE=RAWDATA / 1 LNAME 1-13 (A) FNAME 15-24 (A)<br />

MMAIDENL 40-55.<br />

VAR LABELS MMAIDENL ’MOTHER’’S MAIDEN NAME’.<br />

DO IF (MMAIDENL EQ ’Smith’).<br />

WRITE OUTFILE=SMITHS/LNAME FNAME.<br />

END IF.<br />

EXECUTE.<br />

• This example writes the last and first names of all people whose mother’s maiden name<br />

was Smith to the data file SMITHS.<br />

• DO IF—END IF and WRITE do not read data and are executed only when data are read for<br />

a procedure. Because there is no procedure in this session, EXECUTE is used to read the<br />

data and execute all of the preceding transformation commands. Otherwise, the commands<br />

would not be executed.<br />

528

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

Saved successfully!

Ooh no, something went wrong!