Hi All,
Is there a way to create create one report using proc tabulate by reading two datasets?
Please find sample layout attached.
Regards,
Thokozani
There probably is. Depends on how your data relates to each other. You would either need to summarise each then merge together, or merge together and then summarise. Hard to say, please provide test data (in the form of a datastep) for each of your data and might be able to see.
RW9 was right on the money. Pre-summarization is the way. And please provide some sample data.
Just to make certain upfront: there is no way to specify two tables in the PROC TABULATE statement/ It's just not in the syntax. A view would be the closest you can get to "Tabulate reading two datasets".
"Table" has enough uses that one needs to be just a bit precise when mixing usages (Data table, report table, table statement as a minimum). Which is why SAS often refers to data sets for the data, referenced in most procedures with statement data=, and table for output.
Proc Tabulate and most procedures accept a single dataset as input. Many of the procedures produce multiple tables as output.
Proc Tabulate does support multiple Table statements in a single procedure call, so you can get significantly different bits of output with a single data set reference. But the input will only be a single data set.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.