BookmarkSubscribeRSS Feed
Onur_Goekcen
Fluorite | Level 6


Hi,

I would like to store the generated HTML code(including all tags) as text/string in a dataset column instead of printing it out into a HTML document. Is there an ODS option to do this in SAS?

Any hints appreciated, thank you.

Onur

4 REPLIES 4
Amir
PROC Star

Hi,

I'm not sure if there is an option to do this.

It might not be efficient, but have you considered creating the file then reading it in SAS to create your data set.

Regards,

Amir.

Cynthia_sas
SAS Super FREQ

Hi,

There is no ODS option to automatically do this in your ODS invocation statement or SAS options. However, you can always post-process the HTML file, after ODS creates the file, and read the HTML into a SAS dataset (using INFILE/INPUT syntax). However, I don't really understand why you would want to do this. It is possible, but I'm not sure what the utility of such a dataset would be.

cynthia

Onur_Goekcen
Fluorite | Level 6

Hi, thanks for your replies.

We are generating approx. 5k HTML files(each file is the evaluation result of a risk method) per year in scope of our risk method validation process. These outputs are published in our web platform only and are not accessed directly.To ease the maintenance of physically stored files, we are tending to this approach.

I'll try to read the files after they are generated.

Onur

Cynthia_sas
SAS Super FREQ

Hi,

  I guess I don't understand the maintenance issues. Wouldn't you just add HTML files for every year or risk scenario? So, as long as you have write access to a browser folder, this year, you might have something like this:

report_2010_r1.html

rejport_2010_r2.html

report_2011_r1l.html

report_2011_r2.html

report_2012_r1.html

report_2012_r2.html

report_2013_r1.html

report_2013_r2.html

...and then next year you would add report_2014_r1.html etc, etc...

  As long as you keep your original datasets that were used to create the HTML files, you should be able to recreate any of the HTML files. Or, you could store the procedure results in an ODS DOCUMENT store, for archive purposes. Having the HTML tags and output in a SAS dataset just give you a different maintenance issue -- instead of 5K HTML files, won't you have 5K SAS datasets to maintain if you make a dataset for every HTML file? Once you had the HTML in a SAS dataset, how do you envision using these SAS datasets?  Also, I don't understand what you mean when you say that the outputs are "published in our web platform only and are not accessed directly." If the HTML outputs are not accessed, why bother saving them?

  If you're using SAS/IntrNet or the BI Platform or stored processes, you could dynamically generate an output when you need it. Or you could have a macro program that took a year or a set of parameters to control the number of HTML files that were created.

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