We’re smarter together. Learn from this collection of community knowledge and add your expertise.

Top 10 Ways to Optimize Your SAS Code - Ask The Expert

by SAS Employee JeffSimpsonSAS 4 weeks ago - edited 4 weeks ago by Community Manager (1,979 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.


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:


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

 A: 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.


Your turn
Sign In!

Want to write an article? Sign in with your profile.