Base SAS is core skill for every SAS programmer. Understanding the datastep completely is essential for SAS programmers who want to write efficient bug free code. New updates of SAS regularly expand what is achieveable in one datastep and allow the programmer to improve the efficiency of their code. The purpose of this page is to keep upto date with the latest efficiency techniques and procedures.
Top 5 SAS Efficiency Savings
- options compress = Yes;
In most implimitations of SAS writing out large datasets will be one of the main time consuming factors, by compressing datasets the amount of writing is reduced so as well as saving space you also save time
- Index datasets with variables regularly used to look up variables.
There's no point reading entire datasets when all you need is a a small subset(say less than 30 %) of the dataset, to avoid this consider indexing large datasets.
- Use a where clause to exclude observations you don't want to process.
- Use the keep= dataset option to exclude variables you don't want to process.
- If downloading information from a server try using a passthrough statement in proc SQL to get the server to do the work for you.