![](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
My article about the difference between CLASS variables and BY variables in SAS focused on SAS analytical procedures. However, the BY statement is also useful in the SAS DATA step where it is used to merge data sets and to analyze data at the group level. When you use the