Hi. I'm wondering if there is a way to name the Tab that is created within Excel that holds my Proc Report output? Right now it's getting populated with something by default.
Any help would be much appreciated.
/* EXPORT THE FILE TO XLS USING ODS */
OPTION MISSING = '';
ODS EXCEL FILE="C:\USERS\STEVEBUECHLER\BOX SYNC\IBM\USPS\HRC PAY DATA ANALYSIS\&SITE._HCR_PD_SUMMARY.XLSX";
PROC REPORT DATA=&SITE._HCR_SUMMARY_F;
title "&site_nm HCR Pay Data Summary";
define area / style(column)=[cellwidth= 2in] ;
COMPUTE AREA;
IF FIND(AREA,"AREA SITE GRAND TOTAL") THEN
CALL DEFINE(_ROW_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=BLUE]");
ENDCOMP;
COMPUTE PAY_DATA_MONTH_CHR;
IF FIND(PAY_DATA_MONTH_CHR,"HCR CONTRACT TOTAL") THEN
CALL DEFINE(_ROW_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE ACTIVITY_DESCRIPTION;
IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=DARKGREEN
BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE FREQ;
IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=DARKGREEN
BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE PAY_AMOUNT;
IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=DARKGREEN
BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE RATE_PER_UNIT;
IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=DARKGREEN
BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE UNITS;
IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
FOREGROUND=DARKGREEN
BACKGROUND=HONEYDEW]");
ENDCOMP;
COLUMNS _ALL_;
RUN;
ODS EXCEL CLOSE;
There are dozens of options in ODS EXCEL, and you would be wise to familiarize yourself with them.
In particular, to answer your question
ods excel file="whatever.xlsx" options(sheet_name='Fred Flintstone');
There are dozens of options in ODS EXCEL, and you would be wise to familiarize yourself with them.
In particular, to answer your question
ods excel file="whatever.xlsx" options(sheet_name='Fred Flintstone');
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.