BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sanjay1
Obsidian | Level 7

Hi SAS Experts,

 

I am using ods excelxp to output xml files and to wrap the text columns, and am able to do that. But by default ods excelxp is opening the xml files after exporting them, here I want to stop this default behaviour of ods excelxp, is there is any options to do this.

Actually there more than 100 files am creating using excelxp concept and it witll be difficult for me to close them each time.

 

Here is my code.

 

data a;
set sashelp.class;
run;


data a;
set a;
amount=age*weight;
run;

proc sql;
select count(distinct sex) into : c from a;
quit;

proc sql;
select distinct sex into:sex1-:sex%sysfunc(compress(&c)) from a;
quit;

 

%macro b;
%do i=1 %to &c;
ods tagsets.excelxp file="path\a_&&sex&i...xml" style=statistical options(absolute_column_width='10,5,5,5,5');
proc print data=a noobs;
var name sex age weight height;
var amount/style(data)={tagattr='format:"$"#,##0'};
where sex="&&sex&i.";
run;
ods tagsets.excelxp close;
%end;
%mend b;
%b;

 

Thanks & regards,

Sanjay.

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Put before your code:

ods noresults;

 

And afterwards:

 

ods results;

 

This turns off the resulting output.

 

Just to add, why are you creating 100 odd files?  Doesn't seem to be the most efficient use of disk space or reviewers time?  Its simpler to code to output to a new sheet each time, cuts down numbers of files.

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Put before your code:

ods noresults;

 

And afterwards:

 

ods results;

 

This turns off the resulting output.

 

Just to add, why are you creating 100 odd files?  Doesn't seem to be the most efficient use of disk space or reviewers time?  Its simpler to code to output to a new sheet each time, cuts down numbers of files.

sanjay1
Obsidian | Level 7

Hi RW9,

 

yeah you are right, actually am creating this for distinct users.

 

Thank you its working for me.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 955 views
  • 0 likes
  • 2 in conversation