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.

Keyword TO<br />

Variables 23<br />

You can establish names for a set of variables or to refer to any number of consecutive variables<br />

by specifying the beginning and the ending variables joined by the keyword TO.<br />

To establish names for a set of variables with the keyword TO, use a character prefix with<br />

a numeric suffix.<br />

• The prefix can be any valid name. Both the beginning and ending variables must use the<br />

same prefix.<br />

• The numeric suffix can be any integer, but the first number must be smaller than the<br />

second. For example, ITEM1 TO ITEM5 establishes five variables named ITEM1, ITEM2,<br />

ITEM3, ITEM4, and ITEM5.<br />

• Leading zeros used in numeric suffixes are included in the variable name. For example,<br />

V001 TO V100 establishes 100 variables, V001, V002, V003, ..., V100. V1 TO V100 establishes<br />

100 variables, V1, V2, V3, ..., V100.<br />

The keyword TO can also be used on procedures and other commands to refer to consecutive<br />

variables on the working data file. For example, AVAR TO VARB refers to the variables AVAR<br />

and all subsequent variables up to and including VARB.<br />

• In most cases, the TO specification uses the variable order on the working data file. Use<br />

the DISPLAY command to see the order of variables on the working data file.<br />

• On some subcommands, the order in which variables are named on a previous<br />

subcommand, usually the VARIABLES subcommand, is used to determine which variables<br />

are consecutive and therefore are implied by the TO specification. This is noted in the<br />

description of individual commands.<br />

Keyword ALL<br />

The keyword ALL can be used in many commands to specify all the variables in the working<br />

data file. For example:<br />

FREQUENCIES /VARIABLES = ALL.<br />

or<br />

OLAP CUBES income by ALL.<br />

In the second example, a separate table will be created for every variable in the data file, including<br />

a table of income by income.<br />

System Variables<br />

System variables are special variables created during a working session to keep systemrequired<br />

information, such as the number of cases read by the system, the system-missing<br />

value, and the current date. System variables can be used in data transformations.<br />

• The names of system variables begin with a dollar sign ($).<br />

• You cannot modify a system variable or alter its print or write format. Except for these<br />

restrictions, you can use system variables anywhere a normal variable is used in the transformation<br />

language.

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

Saved successfully!

Ooh no, something went wrong!