I have written a macro to ease my analysis of hospital discharge data. When exporting my output via ods tagsets.excelxp, the spreadsheet produced contains the correct row/column formats, however all the numbers/values are missing from the spreadsheet. Please see code below and advise: *will need to sort data by intent, before running macro; proc sort data=hospital.injury_HDD_C09_C13; by inj; run; *macro written for injury counts by intent and mechanism followed by variables of interest; %macro HDD_Counts (var); proc freq order=freq data=hospital.injury_HDD_C09_C13; Tables cause*&var/missing; by inj; format cause ca. inj int. agecat2 agecattwo. femage femage. maleage maleage. RACEth RACEth. patstat patstat. Fac fac. county county_name. region region. population population. ISRCODE INM. ISRSITE2 I2M. ISRSITE3 I3M. ISRSITE ISM. inj INJM. ; run; %mend HDD_Counts; *HDD mechanism by intent injury counts: admission years (2009-2013); ods tagsets.excelxp file = 'G:\WIPP\Data Analyses\Descriptive Analysis\Ayear by Intent and Mech.xml' style=statistical; ods tagsets.excelxp options (sheet_interval= 'bygroup'); %HDD_Counts (var=ayear); ods tagsets.excelxp close;
... View more