INTO Keyword (RANK command)

INTO specifies variable names for the new variable(s) added to the active dataset. INTO can be used with any of the function subcommands.

  • INTO must follow a function subcommand. You must specify the INTO subcommand to assign names to the new variables created by the function.
  • You can specify multiple variable names on INTO. The names are assigned to the new variables in the order they are created (the order the variables are specified on the VARIABLES subcommand).
  • If you specify fewer names than the new variables, default names are used for the remaining new variables. If you specify more names, the program issues a message and the command is not executed.

If INTO is not specified on a function, RANK creates default names for the new variables according to the following rules:

  • The first letter of the ranking function is added to the first seven characters of the original variable name.
  • New variable names cannot duplicate variable names in the active dataset or names specified after INTO or generated by default.
  • If a new default name is a duplicate, the scheme XXXnnn is used, where XXX represents the first three characters of the function and nnn is a three-digit number starting with 001 and increased by 1 for each variable. (If the ranking function is N, XXX is simply N.) If this naming scheme generates duplicate names, the duplicates are named RNKXXnn, where XX is the first two characters of the function and nn is a two-digit number starting with 01 and increased by 1 for each variable.
  • If it is not possible to generate unique names, an error results.

Example

RANK VARIABLES=SALARY
 /NORMAL INTO SALNORM
 /SAVAGE INTO SALSAV
 /NTILES(4) INTO SALQUART.
  • RANK generates three new variables from variable SALARY.
  • NORMAL produces the new variable SALNORM. SALNORM contains normal scores for SALARY computed with the default formula BLOM.
  • SAVAGE produces the new variable SALSAV. SALSAV contains Savage scores for SALARY.
  • NTILES(4) produces the new variable SALQUART. SALQUART contains the value 1, 2, 3, or 4 to represent one of the four percentile groups of SALARY.