3 of 30: Tricks for reducing CPU time

0

Do you remember when CPU time was a high-priced commodity? "Today, if you are any good at what you do, the constrained resource is you," says Timothy Berryhill from Wells Fargo. Berryhill has years of experience with SAS on "many platforms and operating systems." He says there are several things you can do to save your time - and your company's money.

According to Berryhill, there are two very important things you can do to make the best of your time and those who look at your code later: Make sure your code is clear and correct. "To me, the main thing is correct. If the answers are wrong, it doesn't matter how you got there," he says.

Here are three of his tried-and-true tips:

  1. "I like to use the %LET, particularly at the top of my code where variables are going to change," says Berryhill. He use a series of the %LET at the top of the program to remind him of changes he needs to make.
  2. The NOBS option tells you how many observations you have in a dataset. According to Berryhill, the option is most useful when NOBS is 0. "If you try to do a PROC PRINT or a global dataset, you set that empty dataset, and Boom you're gone. (This only works for disk files, not views or tapes.)"
  3. Try your luck. When he isn't on a tight deadline, Berryhill says that he likes to experiment with code just to see if it  works. Recently, he found that the double question mark will suppress expected errors in the input function. "I was surprised to find out that it is also supported in a statement."

Read 27 more of Berryhill's SAS tricks in his paper, "30 in 20 things you may not know about SAS."

Share

About Author

Waynette Tubbs

Editor, Marketing Editorial

Waynette Tubbs is a seasoned technology journalist specializing in interviewing and writing about how leaders leverage advanced and emerging analytical technologies to transform their B2B and B2C organizations. In her current role, she works closely with global marketing organizations to generate content about artificial intelligence (AI), generative AI, intelligent automation, cybersecurity, data management, and marketing automation. Waynette has a master’s degree in journalism and mass communications from UNC Chapel Hill.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top