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.

<strong>Syntax</strong> Rules<br />

KEYED DATA LIST 783<br />

• Specifications for the variable definitions are the same as those described for DATA LIST.<br />

The only difference is that only one record can be defined per case.<br />

• The FILE HANDLE command must be used if the FILE subcommand is specified on KEYED<br />

DATA LIST.<br />

• KEYED DATA LIST can be specified in an input program, or it can be used as a transformation<br />

language to change an existing working data file. This differs from all other input<br />

commands, such as GET and DATA LIST, which create new working files.<br />

Operations<br />

Example<br />

• Variable names are stored in the working file dictionary.<br />

• Formats are stored in the working file dictionary and are used to display and write the<br />

values. To change output formats of numeric variables, use the FORMATS command.<br />

FILE HANDLE EMPL/ file specifications.<br />

KEYED DATA LIST FILE=EMPL KEY=#NXTCASE IN=#FOUND<br />

/YRHIRED 1-2 SEX 3 JOBCLASS 4.<br />

• FILE HANDLE defines the handle for the data file to be read by KEYED DATA LIST. The<br />

handle is specified on the FILE subcommand of KEYED DATA LIST.<br />

• KEY on KEYED DATA LIST specifies the variable to be used as the access key. For a directaccess<br />

file, the value of the variable must be between 1 and the number of records in the<br />

file. For a keyed file, the value must be a string.<br />

• IN creates the logical scratch variable #FOUND, whose value will be 1 if the record is<br />

successfully read, or 0 if the record is not found.<br />

• The variable definitions are the same as those used for DATA LIST.

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

Saved successfully!

Ooh no, something went wrong!