BookmarkSubscribeRSS Feed
Fluorite | Level 6

Hi everyone,

I've been using Proc SQL summary functions for some time until today when a friend of mine (a student, by the way) who has been using SAS for years at the university advised me not to use Proc SQL for large data sets because it is slow. He instead suggests using DOW loop, as in the following article:

Could you SAS experts please advise which one is better for large datasets (>5GB)? What is the main advantage of DOW loop over Proc SQL summary function? Say I want to compute the percentage of money that each mutual fund invested in each of the sample firms for each of the quarters over the 20 years. The Proc SQL summary function is simple to use, and I have been using it for such a purpose.

Thank you so much

Opal | Level 21

While DOW loops are a construct that can be beneficial, and can be faster (especially if your data are already sorted), the programming can easily get to be a lot more complex than what you are currently doing and, as a result, the likelihood of your producing erroneous results can increase significantly.

Yes, SQL can be slow with large files (although that has improved quite a bit with recent SAS versions), but quite easy to code.  If you are looking for faster processing, and don't want to risk errors due to faulty programming, I would compare proc summary with proc sql for what you are doing.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation