BookmarkSubscribeRSS Feed
nerdday
Calcite | Level 5

Hello, SAS community,

 

I'm trying to export 4 datasets to single sheet, which is no problem.  The problem revolves around getting the auto filter on more than one of the outputs.  When using the autofilter option, it only applies it to at most just one of the data sets.  However to apply it to all 4 datasets.  Below is a rough layout of the code.

 

ods listing close;

  ods tagsets.excelxp file= "&output./&file_name..xls" style=normal

  options (orientation = "landscape"

           embedded_titles= "yes"

           embedded_footnotes= 'no'

           sheet_name = "&sheet_name."

           gridlines= "yes"

           thousands_separator = ","

           fittopage= "yes"

           sheet_interval= "NONE"

           merge_titles_footnotes= 'yes'          

           wraptext='yes'                                          

           autofilter='all'

           autofilter_table = '1'

           autofit_width='yes'                      

           orientation='landscape'                                           

           absolute_column_width='20'                                                                          

           row_heights='0,0,0,0,0,0,0');

.

.

.

proc report1

run;

.

.

.proc report4 

,

,

ods tagsets.excelxp  close;

 

 

I tried the following:

'1,2,3,4'

'1-4'

I even tried putting a different option statement in front of each proc report while keeping the tagsets open until the end.  However, even that did not put autofilters on more than one sheet.

 

Thanks for any help you could provide.

1 REPLY 1
Vince_SAS
Rhodochrosite | Level 12

Can you do this manually in Excel?  I think that Excel only allows AutoFilters on a single "table".  Try it using the attached "AutoFilter.xlsx" file.

 

Vince DelGobbo

SAS R&D

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1245 views
  • 0 likes
  • 2 in conversation