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?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.