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');
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: