Hello,
I have a user with an issue where she is running multiple chuncks of sas code and she wants each result in it's own html file not combined. Currently it takes all the output and creates the html file.
I had her try using the following code, but it isn't working as expected. She gets blank results even when the log says there should be data.
ods html close;
ods html;
Is there an option in SAS to make every result a seperate html file?
Thank you
Hi Jerry,
here is some trivial example to output data in two different files. Hope this is what you are looking for.
ods html body="/folders/myfolders/sasuser.v94/test1.html";
data test;
x=1;
run;
proc print data=test;
run;
ods html close;
ods html body="/folders/myfolders/sasuser.v94/test2.html";
data test2;
y=2;
run;
proc print data=test2;
run;
ods html close;
This produces two html files with different sets.
Of course you might have to adjust the filesnames (after body=) as you like.
jefreytag,
Thanks for the reply.
I don't mean to create the actual html files myself.
I'm talking about the html files that SAS generates when there are results to view.
Within options -> Perferences -> Results
Create listing, Create HTML and View results as they are generated are check.
The HTML file that SAS is creating is showing all the output not just the output from that specific SAS code.
You mean you only want to have some of the general output printed? Like when you have three "proc print"s, you only want the output from the third? Or do you want to open multiple result tabs? I still do not quite get it.
Hi Cynthia,
Thank you so much for your reply. We are using Base SAS in a windows eviroment. Is there a way to clear the cumulative output every time before she runs the next section of code?
I will read the paper and see what I can use from there. Thank you for your help.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.