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.

786 KEYED DATA LIST<br />

• KEY is required. Its only specification is a single variable. The variable can be a permanent<br />

variable or a scratch variable.<br />

• For direct-access files, the key variable must be numeric, and its value must be between<br />

1 and the number of records in the file.<br />

• For keyed files, the key variable must be string. If the keys are numbers, such as social<br />

security numbers, the STRING function can be used to convert the numbers to strings. For<br />

example, the following might be required to get the value of a numeric key into exactly<br />

the same format as used on the keyed file:<br />

COMPUTE #KEY=STRING(123,IB4).<br />

IN Subcommand<br />

IN creates a numeric variable whose value indicates whether or not the specified record is<br />

found.<br />

• IN is required. Its only specification is a single numeric variable. The variable can be a<br />

permanent variable or a scratch variable.<br />

• The value of the variable is 1 if the record is successfully read or 0 if the record is not<br />

found. The IN variable can be used to select all cases that have been updated by KEYED<br />

DATA LIST.<br />

Example<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 />

• IN creates the logical scratch variable #FOUND. The values of #FOUND will be 1 if the<br />

record indicated by the key value in #NXTCASE is found or 0 if the record does not exist.<br />

TABLE and NOTABLE Subcommands<br />

TABLE and NOTABLE determine whether the program displays a table that summarizes the<br />

variable definitions. TABLE, the default, displays the table. NOTABLE suppresses the table.<br />

• TABLE and NOTABLE are optional and mutually exclusive.<br />

• The only specification for TABLE or NOTABLE is the subcommand keyword. Neither subcommand<br />

has additional specifications.

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

Saved successfully!

Ooh no, something went wrong!