BookmarkSubscribeRSS Feed
Pedrino
Calcite | Level 5

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;

4 REPLIES 4
Ksharp
Super User

Not sure. Try another option  PRINTMISS

Pedrino
Calcite | Level 5

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.

Tom
Super User Tom
Super User

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)

Pedrino
Calcite | Level 5

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?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 742 views
  • 0 likes
  • 3 in conversation