BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi to all,
I have a html report which is in megabytes that makes impossible to view using IE.
So,i want to create a sas dataset from that html report .I tried using XML engine to import the html report but somehow it doesn't like it.The following is the code i used.I know i am missing something,but i am not able to find what it is.
Also,my question Is it possible to create a sas dataset from html file.?. If possible please explain how?.
Thanks a lot.
Please help!!!!!!!!!!.
Thanks.

libname xml xml "/pii/saspii/pii/Daily/daily_bigrun100.Html";
libname one "/pii/saspii/pii_testfiles/testbig";

data xml.PIIT;
set sashelp.class;
run;

data _class_;
set PIIT;
run;

proc print ;
run; Message was edited by: kgunase
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
HTML is not XML -- yes, they are both "related" to SGML -- but they are more like distant cousins, than brothers. They are not interchangeable file types. A browser will open and render an XML file, only if the XML file contains an XML processing instruction for a CSS file or an XSL file.

The XML Libname engine is meant to be used on non-hierarchical XML data files. It would not be the appropriate technique to use to read an HTML table into a SAS dataset.

You can use the URL access method on the FILENAME statement to read an HTML file from a web site:
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000223242.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001282569.htm

Depending on what is in your HTML file, however, (if there are a lot of IMG tags or embedded JavaScript), you might need to work with Tech Support because the URL access method is meant to open an HTML file from a web site, using either the HTTP or HTTPS protocol.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 609 views
  • 0 likes
  • 2 in conversation