BookmarkSubscribeRSS Feed
mahisankaran
Calcite | Level 5

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?

2 REPLIES 2
ger15xxhcker
Quartz | Level 8

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;
LinusH
Tourmaline | Level 20

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?

Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 800 views
  • 0 likes
  • 3 in conversation