Finding Shortcuts in Programming |
Detailed information about using arrays can be found in SAS Language Reference: Concepts. Arrays can be single or multidimensional.
information about DO groups and iterative DO loops can be found in SAS Language Reference: Dictionary.
Iterative DO statements are flexible and powerful; they are useful in many situations other than array processing. The range of the index variable can start and stop with any number, and the increment can be any positive or negative number. The range of the index variable can be given as starting and stopping values; the values of the DIM, LBOUND, and HBOUND functions; a list of values separated by commas; or a combination of these. A range can also contain a WHILE or UNTIL clause. The index variable can also be a character variable (in that case, the range must be given as a list of character values). The DIM, LBOUND, and HBOUND functions are documented in SAS Language Reference: Dictionary.
A DO WHILE statement processes a loop as long as a condition is true; a DO UNTIL statement processes a loop until a condition is true. (A DO UNTIL loop always processes at least once; a DO WHILE loop is not processed at all if the condition is initially false.) For more information, see SAS Language Reference: Dictionary.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.