Size: 1707
Comment:
|
← Revision 4 as of 2023-06-14 19:31:53 ⇥
Size: 1711
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 33: | Line 33: |
* [[SPSS/Break|BREAK]] | * [[SPSS/Loop#Break|BREAK]] |
Line 42: | Line 42: |
* [[SPSS/MissintgValues|MISSING VALUES]] | * [[SPSS/MissingValues|MISSING VALUES]] |
SPSS Do Repeat
The DO REPEAT command loops a finite number of times. See here for options and alternatives.
Contents
Usage
do repeat X='A' 'B' 'C' 'D' 'E' / Y=new1 to new5 / Z=1 to 5. if ltrim(rtrim(foo))=X Y=Z. end repeat.
Each loop expansion list must be of the same length.
The dummy variable name must follow normal rules for variable names. It is allowed to temporarily shadow a pre-existing variable's name.
Substitutions are only made on unquoted words, i.e. BAR does not have the A substituted by the loop expansion.
A variable list can be specified with all pre-existing variables, or all new variables. The two cannot be mixed. For new variable lists, a range is extrapolated from the names. New variables are not created by the DO REPEAT command.
Limitations
Only the following commands are valid in a DO REPEAT structure.
Data Model
The DO REPEAT command is queued as a pending transformation.