BookmarkSubscribeRSS Feed
JasonNC
Quartz | Level 8

Hi,

I mostly do my claculations in Proc Sql but it takes some good amount of steps.I came to know that we can use Proc Tabulate.I just want to know which is the better way and which takes less time if i have huge data.Any suggestions will be appreciated.

5 REPLIES 5
Augusto
Obsidian | Level 7

Hi JasonNC

Could you please share your Proc Sql code for we suggest a better solution to you?

Augusto.

PGStats
Opal | Level 21

If your data is already sorted as expected by PROC TABULATE then the procedure is quite efficient and can save YOU a lot of time and effort. At least, that's my experience.

PG

PG
Haikuo
Onyx | Level 15

Efficiency wise, I also suggest you take a look into hash object. After SAS 9.2, Hash is capable to do lots of summary and does support non-unique key.

Regards,

Haikuo

Reeza
Super User

Depends on what you're calculating.

If you need distinct counts of something SQL will give that you more easily, perhaps HASH as well, but I'm not familiar with that.

Otherwise tabulate is very convenient, but proc means and summary also do very nice summaries. You can also look into the ODS tables to get more customizable output.

ballardw
Super User

I generally think of SQL for data manipulation and TABULATE for data presentation.

Suppose I want to display some test results with nested leveles of display such as a region and subregions for rows and age-group and gender for columns and cells to represent mean and stand deviation of test scores.

Tabulate will do that quite nicely and present it in a pretty nice looking table. Adding in the ability to group and display data using MULTILABLE formats and/or forcing all formatted values of variables to appear if desired it gets pretty powerful.

You can get output from tabulate but in my experience it is an odd day when I need to.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2426 views
  • 0 likes
  • 6 in conversation