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

Hello,

I am trying to export a proc tabulate results to excel file and every time I run, it prompts a window asking permission to open,save or close the file, something like "Do you want to open oe save this file? Is there a way to disable the prompt?

Below is my code

ods html file= "E:\report.xls";

Proc tabulate data=sims_data;

... ;

...;

run;

ods html close;

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
ArtC
Rhodochrosite | Level 12

You are using the HTML destination to create HTML output.  The XLS extension tells windows  to open the file using excel. Although excel knows how to open an html file, it prompts you to be sure.

Consider using the excelxp tagset to save the file as an XML file.

ods tagsets.excelxp file= "c:\report.xml";

Proc tabulate data=sashelp.class;

class sex age;

var height;

table age,sex*height*mean;

run;

ods tagsets.excelxp close;

View solution in original post

3 REPLIES 3
ArtC
Rhodochrosite | Level 12

You are using the HTML destination to create HTML output.  The XLS extension tells windows  to open the file using excel. Although excel knows how to open an html file, it prompts you to be sure.

Consider using the excelxp tagset to save the file as an XML file.

ods tagsets.excelxp file= "c:\report.xml";

Proc tabulate data=sashelp.class;

class sex age;

var height;

table age,sex*height*mean;

run;

ods tagsets.excelxp close;

pawan
Obsidian | Level 7

Hi Art, I'm too facing a similar issue. Although I divert the output to XML still I get a prompt (window named as File Download) whether to Open or Save or Cancel. Is there any option like NoPrompt or open_excel="no"? I'm using sheet_name=" " option as I got to load data into multiple tabs.

ODS TAGSETS.EXCELXP FILE ="C:\.....\FILENAME.XML";

TITLE        " Title for 1st sheet";

ODS TAGSETS.EXCELXP OPTIONS(SHEET_NAME="SUMMARY" EMBEDDED_TITLES="yes" ABSOLUTE_COLUMN_WIDTH='10,15,8,....');

   Proc Steps....

TITLE        "  ";

TITLE        " Title for 2nd sheet";

ODS TAGSETS.EXCELXP OPTIONS(SHEET_NAME="DATA" EMBEDDED_TITLES="yes" ABSOLUTE_COLUMN_WIDTH='10,15,8,....');

   Proc Steps....

TITLE        "  ";

ODS _ALL_ CLOSE;


Look forward for your valuable suggestions, Pawan

vicky07
Quartz | Level 8

It worked. Thank You!!

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 2213 views
  • 0 likes
  • 3 in conversation