Chapter Contents |
Previous |
Next |
Language Reference |
The start, stop, and increment values should be scalars or expressions with evaluations that yield scalars. The variable is given a new value for each repetition of the group. The index variable starts with the start value, then is incremented by the increment value each time. The iterations continue as long as the index variable is less than or equal to the stop value. If a negative increment is used, then the rules reverse so that the index variable decrements to a lower bound. Note that the start, stop, and increment expressions are evaluated only once before the looping starts.
For example, the statements
do i=1 to 5 by 2; print 'THE VALUE OF I IS:' i; end;produce the output
I THE VALUE OF I IS: 1 I THE VALUE OF I IS: 3 I THE VALUE OF I IS: 5
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.