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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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