BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
stats2555
Calcite | Level 5

I'm currently exporting results of my proc mixed analysis using ODS with the following code:

 

FILENAME out 'filename.xls';
ods listing close;
ods excel file=out;

<code here>

ods excel close;
ods listing;

 

It's giving my results in excel format, but each table from my results ends up in a different tab in the excel file.  Is it possible to only export one table (i.e. least square means)?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

First, you should be using an XLSX extension.

 

All the tables generated between and ODS destination and it's close will go to the ODS destination.

If you one want one table from a procedure that produces more then you would add an "ODS SELECT <tablename>; statement. Tablename is the specific table output you want. Without knowing the code you ran I can't guess which that would be.

 

You can place your procedure code between an ODS Trace on; <proc> ; Ods trace off; pair and the LOG will show the names of all the tables generated by the procedure.

View solution in original post

1 REPLY 1
ballardw
Super User

First, you should be using an XLSX extension.

 

All the tables generated between and ODS destination and it's close will go to the ODS destination.

If you one want one table from a procedure that produces more then you would add an "ODS SELECT <tablename>; statement. Tablename is the specific table output you want. Without knowing the code you ran I can't guess which that would be.

 

You can place your procedure code between an ODS Trace on; <proc> ; Ods trace off; pair and the LOG will show the names of all the tables generated by the procedure.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 681 views
  • 1 like
  • 2 in conversation