DATA Step, Macro, Functions and more

Output exported with correct formatting, however blank value/numbers

Reply
New Contributor
Posts: 3

Output exported with correct formatting, however blank value/numbers

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;

Super User
Posts: 10,046

Re: Output exported with correct formatting, however blank value/numbers

Not sure. Try another option  PRINTMISS

New Contributor
Posts: 3

Re: Output exported with correct formatting, however blank value/numbers

Hi Xia,

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.

Super User
Super User
Posts: 7,079

Re: Output exported with correct formatting, however blank value/numbers

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)

New Contributor
Posts: 3

Re: Output exported with correct formatting, however blank value/numbers

Hi Tom,

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?

Ask a Question
Discussion stats
  • 4 replies
  • 255 views
  • 0 likes
  • 3 in conversation