SAS Tips and Tricks

Using SAS arrays and do loops

At the era of the big data, it's very common to have lot of variables to manipulate in blocks of variables. Arrays and Do loops are powerful data manipulation tools that help make code more efficient for repetitive operation.


SAS arrays are Data Step objects allowing you to group and reference your variables. Once created, the variables of your array are called elements and can be dynamically referenced by their position in the array. This technic is particularly interesting if you have to modify the values of x variables in your dataset, in that case you just have to know the position of your variables in your array to process them. Do loop, allows you to execute statements repetitively. Combining SAS arrays with do loop allows you to treat all the elements dynamically, that is the reason why both topics are often discussed together.
In this tips and tricks we will first talk about the One dimension SAS arrays :

  • Creation of SAS array
  • Get the elements of the array
  • Create variables with SAS array
  • Manipulate SAS array with functions
  • Create temporary array

Then, we will speak about the Do loop:
  • Creating a basic do loop
  • Creating do while and do until loop
  • Creating do loop to process all the elements of a list
  • Leave a do loop

Finally, we will combine both technics in order to read and manipulate all the elements of the arrays thanks to the loops.


You have some SAS experience and want to use SAS arrays and do loops in order to speed up your code development.

Quick Facts

  • Scheduled date: Course not yet scheduled
  • Duration :3 Hours
  • Fee :255 Euros (VAT Exclusive)
  • Language: French/English
  • Included: Coffees, tips and tricks material

Christophe Kabacinski

click here to get more information about this teacher.

Course Location

This course will be organized at : Boulevard Simon Bolivar 34 1000 Bruxelles

Go back to your selection