Software

Get the Scoop on the Loop: How Best to Write a Loop in the DATA Step

Free registration required

Executive Summary

During the execution of the DATA step processing, the DATA step works like a loop, repetitively reading the data and creating observations one at a time. The author calls this type of loop the implicit loop. Sometimes one needs to execute certain SAS statements repeatedly. In this situation, one need to construct an explicit loop by using the DO, DO WHILE, or DO UNTIL statements. There is a wide range of applications for explicit loops, such as generating random samples, reading multiple external data files, and so forth. However, in some scenarios, creating an explicit loop can be very tricky, even for seasoned programmers.

  • Format: PDF
  • Size: 541.8 KB