ODS HTML output into EXCEL Help

Reply
Contributor
Posts: 56

ODS HTML output into EXCEL Help

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

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ODS HTML output into EXCEL Help

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.

Contributor
Posts: 56

Re: ODS HTML output into EXCEL Help

I tried but it's not working.

Second path having excel file giving empty result.

Regards

Shiva

Grand Advisor
Posts: 10,210

Re: ODS HTML output into EXCEL Help

Post code used.

SAS Super FREQ
Posts: 8,719

Re: ODS HTML output into EXCEL Help

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

Ask a Question
Discussion stats
  • 4 replies
  • 215 views
  • 0 likes
  • 4 in conversation