07-31-2015 04:51 PM
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;
*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');
ods tagsets.excelxp close;
08-04-2015 10:02 AM
The data is not missing and the tables are produced in the SAS output and results window. However, when I try to export to excel via tagsets.excelxp, I got blank values.
Thanks for your response.
08-01-2015 10:20 AM
Does it produce numbers when you just direct the output to listing (text) or a dataset (OUT= option on TABLES statement)?
.If not then the issue is your data (or the formats you attached to the CAUSE variable)
08-04-2015 10:01 AM
Output is produced within the SAS output and results window. The tagset.excelxp commands outputs correctly except for the numbers are missing. If I change the ODS export statement to MSOFFICE2K then the output is correctly export except for I'm wanting to create multiple spreadsheets and MSOFFICE2k does not have that function.
Do you have any idea what could be causing the export tagset.excelxp statements to output blank values but correctly row and column formats?