I am attempting to output an excel (xlsx) file using ods excel from a proc output. My variables are in date9. format in the SAS data set, but when they output to excel they are in a text format. This is my code: ods excel file="\\xxxmyfilelocation\Events_%sysfunc(date(),yymmddd10.).xlsx" style=forNESUG options (FLOW='Tables'); ods excel options (zoom='80' sheet_name='Tracker'); proc report data=tracker nowd split= "_" style(column)=[JUST=LEFT VJUST=TOP FONT=(Calibri, 11pt, NORMAL) BORDERSTYLE=SOLID BORDERCOLOR=black] style(header)=[BACKGROUNDCOLOR=light grey FONT=(Calibri, 11pt, BOLD) JUST=CENTER VJUST=TOP BORDERSTYLE=SOLID BORDERCOLOR=black]; column Initial_Code_Date Initial_Attribution_Date Initial_SO_Coverage Date_of_AE_status_Evaluated Initial_Rep_event_became_SAE Type_of_SAE Final_attribution Study_RX_held Treatment_rechallenged Treatment_Permanently_Discontinu Status_AE SO_FU_Log_Comments AF_summary_comments Final_MedDRA_code Final_MedDRA_LLT FINAL_Code_Date Final_Attribution_Date FU_SO_Coverage Initial_site_email_archived_ Final_site_email_archived_ Completed_pharma_reporting_ Closed SO_closed_AE Close_Date Teaching_example Tracker_run_date; define Initial_Code_Date/'Initial Code Date' style={background=lightyellow color=black}; define Initial_Attribution_Date/'Initial Attribution Date' style={background=lightyellow color=black}; define FINAL_Code_Date/'Final Code Date' style={background=lightyellow color=black}; define Final_Attribution_Date/'Final Attribution Date' style={background=lightyellow color=black}; define SO_Log_Comments/'SO Log Comments' style(column) = [just=left cellwidth=3in background=lightyellow color=black] style(header)=Header{background=lightyellow color=black}; define SO_FU_Log_Comments/'SO FU Log Comments' style(column) = [just=left cellwidth=3in background=lightyellow color=black] style(header)=Header{background=lightyellow color=black}; define Reas_NonReportable_AE/'Reas NonReportable AE' style(column) = [just=left cellwidth=0.5in background=lightyellow color=black] style(header)=Header{background=lightyellow color=black}; define Teaching_example/'Teaching example' style={background=lightyellow color=black}; define Closed/'Closed' style={background=lightyellow color=black}; define SO_closed_AE/'SO closed AE' style={background=lightyellow color=black}; define Close_Date/style={background=lightyellow color=black}; options missing=" "; format Initial_Code_Date date11. Initial_Attribution_Date date11. Final_Code_Date date11. Final_Attribution_Date date11. Close_Date date11.; run; I think the issue is my define statement, because the last block of code which exports to a different sheet in the excel workbook exports the date correctly and there is no define statement. proc report data=sites nowd split= "_" style(column)=[BACKGROUNDCOLOR=white JUST=LEFT VJUST=TOP FONT=(Calibri, 11pt, NORMAL) BORDERSTYLE=SOLID BORDERCOLOR=black] style(header)=[BACKGROUNDCOLOR=light grey FONT=(Calibri, 11pt, BOLD) JUST=CENTER VJUST=TOP BORDERSTYLE=SOLID BORDERCOLOR=black]; column SiteNo Name Status Country Status_Date Note; format Status_Date date11.; run; Any suggestions?
... View more