Innovative Techniques: Doing More with Loops and Arrays

From sasCommunity
Jump to: navigation, search

Abstract

DO loops and ARRAY statements are common tools in the DATA step. Together they allow us to iteratively process large amounts of data with a minimum amount of code. You have used loops and arrays dozens of times, but do you use them effectively? Do you take advantage of their full potential? Do you understand what is really taking place when you include these statements in your program?

Through a series of examples let’s look at some techniques that utilize DO loops and ARRAYs. As we discuss the techniques shown in the examples we will also examine the use of the loops and the arrays by highlighting some of the advanced capabilities of these statements. Included are examples of DO and ARRAY statement shortcuts and ‘extras’, the DOW loop, transposing data, processing across observations, key indexing, creating a stack, and others.


Online Materials

View the pdf for the loops and arrays paper.

You can also see the PowerPoint Presentation.

Contact Info

Please check out my user page. You can also email me.