At the era of the big data, it's very common to have lot of variables to manipulate in blocks of variables. Arrays, Do loops and variable lists 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 SAS arrays then we will talk about do loop and finally we will combine them !:
You have some SAS experience and want to use SAS arrays and do loops in order to speed up your code development.
By continuing to browse the site you are agreeing to our use of cookies. Review our cookies information for more details.