Hi all,
I’m trying to write a macro which produces a multi sheet excel workbook using tagsets.excelx. When I run this macro, even though I have 4 passes written at the bottom, which should create a workbook containing 4 sheets produced, only the last sheet (RLEWOLUXA) is generated and contained in the workbook not all 4 sheets. Not sure what code I am missing / not doing.
Any assistance will be greatly appreciated.
%macro datasets ( LD=, SD=);
ods listing close;
options
rightmargin=.1in
leftmargin=.1in
Bottommargin=.1in
topmargin=.1in
Papersize='legal';
ods tagsets.excelxp file="/sasdata/mine/datasets/Report.xls"
style=minimal
options(
ORIENTATION='portrait'
AUTOFIT_HEIGHT='yes'
embedded_titles='yes'
PAGE_ORDER_ACROSS='yes'
sheet_name=&SD.);
TITLE JUSTIFY=l FONT='Arial Narrow' HEIGHT=14pt &LD.;
proc report
data=check nowd
style(column)={just=c font_size=11pt font_face= 'Arial Narrow'cellwidth=2.in}
style(header)={font_size=13pt font_face= 'Arial Narrow' FONT_WEIGHT =BOLD background=CXFFE4E1};
column
c_Total_Responders
m_Total_Responders
Total_Responders_diff
c_total_customers
m_total_customers
total_customers_diff
c_Total_Target_Sales
m_Total_Target_Sales
Total_Target_Sales_diff
c_Total_All_Sales
m_Total_All_Sales
Total_All_Sales_diff;
where Customer_Status =1 and short_description=&sd.;
run; quit;
title;
ods tagsets.excelxp close;
ods listing;
%mend ;
%datasets (LD="Men's Apparel-Core Model ", SD="RLEMECORA ");
%datasets (LD="Women’s Apparel-Core Model ", SD="RLEWOCORA ");
%datasets (LD="Men's Apparel-Luxury Model ", SD="RLEMELUXA ");
%datasets (LD="Women's Apparel-Luxury Model ", SD="RLEWOLUXA " );
... View more