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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.