BookmarkSubscribeRSS Feed
shivakrishna
Fluorite | Level 6

Any one can help how to send the same SAS HTML OUTPUT into a two locations.

For example:

I have a two paths like below;

1) C:\Shiva

2) C:\Shiva\Final

Then i want to save my SAS html output into a excel, the below basic code is saving only one output for one path only.

ODS HMTL FILE="C:\Shiva\TEMP.XLS";

My query is same output want to save in two or more paths.

Could you please help me to overcome this situation.

Thanks

Shiva

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

Can you not have two ods html file= statements one for each path?

If not, just put your reporting in a macro and call it twice each time with different path.

shivakrishna
Fluorite | Level 6

I tried but it's not working.

Second path having excel file giving empty result.

Regards

Shiva

ballardw
Super User

Post code used.

Cynthia_sas
SAS Super FREQ

Hi:

  The problem with having 2 ODS HTML statements (without any unique identifier) is that only 1 instance of a destination can be open at any time in a step. But, when the ODS destination has a unique ID= value, then ODS can have 2 (or more) instances of the same destination open at the same time. You need to investigate the use of the ID= option in order to open 2 instances of the same destination at the same time:
    

ods html(id=1) file='c:\temp\report1.html' style=analysis;

ods html(id=2) file='c:\temp\output\report2.html' style=sasweb;

proc print data=sashelp.class;

run;

ods _all_ close;
    

And, just to clarify what you are doing ... you said "Then i want to save my SAS html output into a excel" -- when you use ODS HTML, you are NOT, NOT, NOT creating a "true, binary" Excel file by naming the file with the .XLS file extension. All you are doing is "fooling" the Windows registry into launching Excel when you double click on the file name. If you look inside the file you create with ODS HTML (using NOTEPAD or any Text Editor --not Microsoft Word), then you will see HTML tags. 


cynthia

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
  • 4 replies
  • 647 views
  • 0 likes
  • 4 in conversation