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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 667 views
  • 0 likes
  • 2 in conversation