DO REPEAT-END REPEAT

The DO REPEAT—END REPEAT structure repeats the same transformations on a specified set of variables, reducing the number of commands you must enter to accomplish a task. This utility does not reduce the number of commands the program executes, just the number of commands you enter.

DO REPEAT stand-in var={varlist  | ALL  } [/stand-in var=...]
                       {value list}

transformation commands

END REPEAT [PRINT]

Release History

Release 14.0

  • ALL keyword introduced.

Example

DO REPEAT var=var1 to var5
         /value=1 to 5.
COMPUTE var=value.
END REPEAT.

This command does not read the active dataset. It is stored, pending execution with the next command that reads the dataset. See the topic Command Order for more information.