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.

Details

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 SAS arrays then we will talk about do loop and finally we will combine them !:

  • Creation of SAS array
  • Manipulate SAS array with variable lists and functions
  • Creating a basic do loop
  • Creating do while and do until loop
  • Creating do loop to process all the elements of a list

Then, we will illustrate the theory with several practical examples
  • replace by 0 all the missing numeric variables
  • Comparing values of a dataset with initial values
  • Convert all characters to upcase
  • Create multidimentional array
  • Rotate dataset from wide to narrow
  • Rotate dataset from narrow to wide

Prerequisites

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: 2020-02-20 from 2 pm to 5 pm
  • 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 : Lodge.co Boulevard Simon Bolivar 34 1000 Bruxelles


Go back to your selection