The World of SAS® Programming

Rick Aster

SAS became the go-to starting point for piecing together answers from large-scale data during the period roughly from 1991 through 2008 largely because it had programming at its core. Most of the people who use SAS today use it because they have ready access to the platform at sites that adopted it during its heyday — and they use it in the same way it was used then, by writing programs that spell out a series of actions to take with data from a particular data source.

Much has changed in the world surrounding SAS programmers. For most data used in SAS work, data security is now the first priority. SAS was once a global phenomenon, but now its use is concentrated mainly in the United States and a handful of other countries. The vast majority of SAS processing now takes place on Linux servers. The once-familiar SAS Display Manager System is largely forgotten, and current users, if they are lucky, are running programs in the browser-based SAS Studio instead. Results from SAS are less likely to be printed on an impact printer and more likely to be delivered as PDF or HTML documents.

Despite the changes, the basic way of working in SAS is the same: write a program, run it, obtain the results, and modify and repeat as needed.


Before there is a program, there is a question. The importance of the question may be obvious. How much workers are available to work tomorrow? In what cases is this drug an effective treatment for this disease? How soon is the car likely to break down? Will the intended readers of this document find it easy enough to read? Is the tax on nuclear power generation high enough to cover the eventual cost of nuclear waste disposal? After a planned merger, how will price changes affect customers?


Once a question has been posed, you can look for data that might be available to answer the question. Data might come from a business process or a study, among many other possible sources. Someone might have already assembled, studied, and documented a relevant body of data. Steps might need to be taken to obtain the data and move it to a place where it can be used.


While there are fully interactive ways to analyze data, there is good reason to do any work that really matters in a computer program. A program tells the computer what to do, so that the process is automated and energy-efficient and can be adjusted and refined at will, but more importantly, the program documents what was done, so that if there are any questions about the way the data was handled, those questions can be answered authoritatively after the fact.

Compared to the many programming languages that might be used for working with data, the advantage of the SAS language is that programs for working with data can be written quickly and easily while still running efficiently, regardless of data size. Another advantage that might occur is if parts of the SAS code already exist — for example, if there is existing SAS code for accessing the data you want to use.

The SAS Platform

In the last quarter century, SAS as a company has gone off in a different direction, emphasizing new micro-targeted products that operate seamlessly but have extremely limited functionality. As a result, most people today are not aware that the SAS language is still present in the core of the SAS platform and that it is still able to deliver all the same answers that it did many years ago, as easily now as it did then.

The Professional SAS Programmer

There might no longer be a place in the world for the dedicated SAS programming specialist, but there is still a reason to aspire to the norms and practices of professional software developers when working in SAS. Keeping track of the code, keeping it neat and easy to read, and making it as general as it can be without adding complexity saves you work in the long run, whether you are working in a 1,000-person project or all by yourself. “General” in this context means that the code does not unnecessarily lock you into the exact way of doing things that you started with. If details of the data change, if the intended results must be adjusted, or even if the code moves from one computer to another, this can all happen with a minimum of fuss because you have prepared for that possibility from the beginning.

 O /\






Download | Rastinate