SAS expertise delivered to your desktop -- on-demand and free!

Join Now

Top 10 Ways to Optimize Your SAS Code

by SAS Employee JeffSimpsonSAS on ‎07-28-2017 04:20 PM - edited Friday by SAS Employee john_bauman (3,338 Views)

Did you miss the Ask the Expert session on Top 10 Ways to Optimize Your SAS Code ?  Not to worry, you can catch it on-demand at your leisure.


Watch the webinar


This session introduces you to ideas and comparisons on ways to Optimize Your SAS Code  and describes how you can take advantage of finding a balance of saving space and time within your SAS Environment.  We will cover the following:


  • Minimizing Reads on INPUT
  • KEEP and WHERE Data Set Options
  • WHERE clause optimization
  • Avoiding Multiple Passes of the Data
  • Indexing Considerations
  • Sorting
  • Avoid Heterogeneous Joins
  • Data Set Compression
  • SAS Dataset as a Table vs. a View
  • Checkpoint/Restarting SAS Jobs

I have added the Q&A from the session below and attached you will find the slides:


In your example of IF THEN .. ELSE IF ...ELSE IF with the states. How does IF THEN ELSE compare to the SELECT (state) statement?

SELECT is simply a different way to handle multiple IF THEN statements. Process times should be similar.  If  you are working with a production job, it is recommended that you do benchmarking to confirm.


Want more tips? Be sure to subscribe to the Ask the Expert Community Library to receive follow up Q/A, slides and recordings from other SAS Ask the Expert webinars. From Ask the Expert Library, just click Subscribe from the orange bar underneath the list of the recent articles.


NOTE: For best results when opening the attached slides, click on the “download” icon.