Hi All,
I have a simple proc tabulate and ODS EXCEL to export to MS Excel. The result has a sheet by every segment.
How I configure the ODS Excel statement to have a segment name as sheet name?
My current SAS code is:
ods excel file="/path/File_Test.xlsx" options(sheet_interval='page');
PROC TABULATE DATA=WORK.Test ;
CLASS Name Segment &columnas / ORDER=UNFORMATTED MISSING;
TABLE Segment, &columnas, Name*ColPctN ;
RUN;
ods excel close;But as results each sheet is named: Tabulate 1 - Table 1, Tabulate 2 - Table 1, etc. Please see the attached file.
Regards,
Thanks @Cynthia_sas, works perfect!
Try the Sheet_Label and Sheet_name options in the ODS EXCEL statement.
You can find a lot of examples online using ODS TAGSETS which is the same approach you need for ODS EXCEL.
https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data
I'm getting some weird behaviour but maybe this will work for you:
proc sort data=sashelp.cars out=cars;
by origin;
run;
ods excel file="c:\_localdata\temp.xlsx" options(sheet_interval="bygroup" sheet_label='');
proc print data=cars;
by origin;
run;
ods excel close;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.