The SAS Output Delivery System and reporting techniques

tagsets excelxp error

Reply
Contributor
Posts: 65

tagsets excelxp error

Hi,

I am trying to export data from SAS dataset to Excel 2007 and I am having the following code to create excel sheet. This macro create the excel file but when I try to open it, it gives me an error saying "File cannot be opened because of erros. Errors are listed in 'Path\44334323.log" file"

Has anyone faced similar issue before, if so, how did you solve it?


Code:

%Macro ABC /parmbuff;

ods listing close;

%put syspbuff contains: &syspbuff;

%let num=1;

%let dsname = %scan(&syspbuff,&num); /* Dataset name */

%let pid = %substr(&dsname,6);       /* Plan ID ex: 01 or 802 */

%let strata = %substr(&dsname, 1,1); /* Strata Number ex: 1 */

%let plannum = %substr(&dsname,2,5); /* Plan number ex: h1609 */

ods tagsets.excelxp file = "A:\ABC.xls" style = sansprinter;

%do %while(&dsname ne);

ods tagsets.excelxp options (sheet_name = %quote("Strata&Strata"));

proc print data = TT.Sample_Strata&dsname.pbp&pid. noobs;

run;

%let num = %eval(&num+1);

%let dsname = %scan(&syspbuff, &num);

%end;

ods tagsets.excelxp close;

%mend ABC;

%ABC(1h999001);

%ABC(1h999001, 1h888902);

Thanks in advance.

I am using SAS 9.3

SAS Super FREQ
Posts: 8,643

Re: tagsets excelxp error

Hi:

  You posted this same question in the SAS Macro forum and it was answered over there.

cynthia

Post a Question
Discussion Stats
  • 1 reply
  • 134 views
  • 0 likes
  • 2 in conversation