Example (AUTORECODE command)

DATA LIST / COMPANY 1-21 (A) SALES 24-28.
BEGIN DATA
CATFOOD JOY            10000
OLD FASHIONED CATFOOD  11200
 . . .
PRIME CATFOOD          10900
CHOICE CATFOOD         14600
END DATA.
 
AUTORECODE VARIABLES=COMPANY /INTO=RCOMPANY /PRINT.
 
TABLES TABLE = SALES BY RCOMPANY
  /TTITLE='CATFOOD SALES BY COMPANY'.
  • AUTORECODE recodes COMPANY into a numeric variable RCOMPANY. Values of RCOMPANY are consecutive integers beginning with 1 and ending with the number of different values entered for COMPANY. The values of COMPANY are used as value labels for RCOMPANY’s numeric values. The PRINT subcommand displays a table of the original and recoded values.