Hi All I have created below code to export my SAS data set into xlsx file with multiple sheets, file got created and sent email with attachment but xls file unable to open , its says file is corrupted, if we manually transfer xlsx file from SAS server to windows Desktop through WINSCP, file gets opened , but its not opening through email and SAS server locations. here is the code. Appreciate your help on this libname x xlsx "/workspace/lob5/alm/u441070/xyz.xlsx"; data x.DQ_Pricing_Completeness; set work.pdq001; run; data x.DQ_Pricing_Integrity; set work.pdq002; run; %macro SendEmailFAST; filename outbox email to=(&emailTo1) from=(&emailFrom) cc=(&emailCC) bcc=(&emailbcc) type='text/html' subject= "Data Quality Run &scn -&dbn &taday" attach="/workspace/lob5/alm/u441070/xyz.xlsx" ; ODS html body=outbox style=Harvest; /*BarrettsBlue*/ /* Pricing*/ Title1 color=red H=3 "Data Quality Exceptions Report NVP Pricing Templates for &scn%"; proc report data=Email_Fast_Rep_Pricing ; columns CNT DQ_Dimension DQRule Field DQCHEK_POINT DQPriority; define DQPriority / display; /* explicitly specify column usage */ define DQCHEK_POINT / display; compute DQPriority; if DQPriority='High' then call define(_col_, "style", "style=[backgroundcolor=Red]"); if DQPriority='Medium' then call define(_col_, "style", "style=[backgroundcolor=coral]"); if DQPriority='Low' then call define(_col_, "style", "style=[backgroundcolor=cyan]"); if DQPriority='No Actions' then call define(_col_, "style", "style=[backgroundcolor=Green]"); endcomp; compute DQCHEK_POINT; if DQCHEK_POINT='Fail' then call define (_col_, 'style', 'style=[foreground=Red]'); endcomp; run; Title1; ods _all_ close; %mend; %SendEmailFAST;
... View more