Hi folks,
I need to generate an Excel file with more than one sheet. In each sheet, I have multiples reports (generated by proc tabulate), one below other. It's very important that the reports are one below other.
I tried the following code but it generates one sheet only with all reports (one below other) and not two sheets as required.
ODS EXCEL FILE="/Test.xlsx"
OPTIONS(START_AT="1,3" SHEET_INTERVAL="none" EMBED_TITLES_ONCE='yes' embedded_titles="yes" SHEET_NAME="Archivo 1") STYLE=Daisy;
/*Report 1*/
PROC TABULATE DATA=SASHELP.CLASS ;
VAR Age;
CLASS Sex / ORDER=UNFORMATTED MISSING;
TABLE Sex,
N
Age*Sum ;
RUN;
/*Report 2*/
PROC TABULATE DATA=SASHELP.CLASS ;
VAR Age;
CLASS Sex / ORDER=UNFORMATTED MISSING;
TABLE Sex,
N
Age*Sum ;
RUN;
ODS EXCEL OPTIONS (START_AT="1,3" SHEET_INTERVAL="none" EMBED_TITLES_ONCE='yes' embedded_titles="yes" SHEET_NAME="Archivo 2") STYLE=Daisy;
/*Report 3*/
PROC TABULATE DATA=SASHELP.CLASS ;
VAR Age;
CLASS Sex / ORDER=UNFORMATTED MISSING;
TABLE Sex,
N
Age*Sum ;
RUN;
/*Report 4*/
PROC TABULATE DATA=SASHELP.CLASS ;
VAR Age;
CLASS Sex / ORDER=UNFORMATTED MISSING;
TABLE Sex,
N
Age*Sum ;
RUN;
ODS _ALL_ CLOSE;I tried removing the option SHEET_INTERVAL="none" but it generate a sheet per proc tabulate, instead only two sheets. Any suggestion?
Thanks @Reeza ! One more question... I'm using "Daisy" style, but my only problem is I need the title align to the left and in this style align to center. I tried to add "align" option on title but it has not effect Any suggestion?
Regards,
@Reeza , yes, I tried it but it's completely ignored, the title remains on center.
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.