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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 912 views
  • 0 likes
  • 2 in conversation