Hello, I'm a beginner at SAS. I'm trying to do excel pivot table analysis in SAS. How to export all the tables from proc tabulate to the excel sheet in one go?
You can export proc tabulate tables to Microsoft Excel by using the Output Delivery System (ODS). You can use the following code to export the tables from proc tabulate to an Excel workbook:
ods excel (id=workbookname) file= "c:\tablulatedata.xlsx";
run;
proc tabulate data=dataset;
class classvariable;
var variable;
table classvariable*variable*output;
run;
ods excel close;
run;
Even though @ger15xxhcker is giving a correct answer, I just want to understand what you really want to do.
I guess you have your data in SAS?
Pivoting in Excel is kind of easy and more flexible than using PROC's in SAS.
But maybe you don't have the necessary means to connect to SAS data from Excel?
Is this one-off or an regular report/application?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.