In a situation where there are several variables to be modified, the Repeat feature allows you to specify a series of variables or fields to be manipulated. The repeat feature is designated by an R following the variable or record/column with the number of variables/columns following.
Example 1:
RECODE Q3_1 R20 (1=5,2=4,4=2,5=1)
This reverses the scale for the next 20 variables starting with Q3_1.
Example 2:
RECODE 1/13 R20 (1=5,2=4,4=2,5=1)
This reverses the scale for variables in column 13 through column 32 of record 1.
Related topics: