BookmarkSubscribeRSS Feed
tparvaiz
Obsidian | Level 7

Hi,

 

I want to some data in the file using ODS HTML process. for somereason, when I run this code below (SAMPLE) the file is saved in the desired destination but it opens up a pop up menu "File download" with an option to Open/Save/Cancel. usually I just press Cancel and the rest of the process runs fine.

 

please advise how to get rid of this popup as my files are already saved without this addiotnal step

 

 

 


ods listing close;
ods html file = "C:\temp\File_&date..xls" style=fancyprinter;

proc tabulate data = temp2 out = incSCR;
class Locations products;
var avg_TAT le_per /style=[cellwidth=2.0 cm background=white];
format products o_code. Locations facility_out.;
table Locations='', products*(avg_TAT="Avg"*f=3. le_per="days"*f=percent10. )/MISSTEXT = "" box = [label = "Locations" style = [cellwidth = 2 cm]];
title1 'Title';
title2 'title';
title3 %bquote(Exams completed: &Date);
keylabel sum = " ";
run;
ods html close;
ods listing;

 

Thanks

2 REPLIES 2
tparvaiz
Obsidian | Level 7

Hi,

 

I am using ods html process to store some values in an excel file... here is a sample that is saving file as per the requirement but for some unknown reason, poping up a window (file download) asking me to select one of the following options: open/save/cancel file. usualy I select cancel and the process proceed to the following steps. is there a way to get rid of this addional step

 

 

 


ods listing close;
ods html file = "C:\temp\File_&date..xls" style=fancyprinter;

proc tabulate data = temp2 out = incSCR;
class Locations products;
var avg_TAT le_per /style=[cellwidth=2.0 cm background=white];
format products o_code. Locations facility_out.;
table Locations='', products*(avg_TAT="Avg"*f=3. le_per="days"*f=percent10. )/MISSTEXT = "" box = [label = "Locations" style = [cellwidth = 2 cm]];
title1 'Title';
title2 'title';
title3 %bquote(Exams completed: &Date);
keylabel sum = " ";
run;
ods html close;
ods listing;

 

 

 

Thanks

Cynthia_sas
SAS Super FREQ

Hi:
When I test a version of your code using SASHELP.CLASS in SAS 9.4 I do NOT get a popup window that asks if I want to do a download.

However, if I run the same code using SAS Enterprise Guide, then while there is NOT a popup window, there IS a download button on the results tab for the ODS HTML output -- but this is normal EG behavior.

When I run the program in SAS Studio, I do not get a popup window. So I am not sure why you are getting a popup window.

I do not normally recommend using the .XLS file extension with ODS HTML because Microsoft Excel can complain about the fact that the file "internals" are HTML, but you've named the file as a .XLS file, which is technically incorrect.

As an aside, I'm not sure why you need an OUT= option -- the format for the tabulate data that's created will not follow the format of the table as shown in the browser or in Excel. So it seems unnecessary. Also you use a macro variable &DATE, but don't show how you set it or why you need %bquote -- and although it would not explain the popup window issue, it's something I wonder about.

cynthia

Here's the code I tried:

ods _all_ close;
ods html file = "C:\temp\File_dispmgr.xls" style=fancyprinter;

proc tabulate data = sashelp.class ;
class age  sex;
var height weight /style=[cellwidth=2.0 cm background=white];
 table age='', sex*mean*(height="ht"  weight="wt"  )/
    MISSTEXT = "" box = [label = "Locations" style = [cellwidth = 2 cm]];
title1 'Title1';
title2 'title2';
 keylabel sum = " ";
run;
ods html close;
ods listing;

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