Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

DO Function

produces an arithmetic series

DO( start, stop, increment)

The inputs to the DO function are as follows:
start
is the starting value for the series.

stop
is the stopping value for the series.

increment
is an increment value.
The DO function creates a row vector containing a sequence of numbers starting with start and incrementing by increment as long as the elements are less than or equal to stop (greater than or equal to stop for a negative increment). This function is a generalization of the index creation operator (:).

For example, the statement

   i=do(3,18,3);
yields the result
         I             1 row       6 cols    (numeric)

         3         6         9        12        15        18
The statement
   j=do(3,-1,-1);
yields the result
          J             1 row       5 cols    (numeric)

          3         2         1         0        -1

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.