DATA Step, Macro, Functions and more

Read html from url with Libname OLEDB

Posts: 1

Read html from url with Libname OLEDB


I'm trying to read html data from URL with Libname OLEDB:

     options validvarname=V7;

     libname tmp OLEDB provider="Microsoft.Jet.OLEDB.4.0"

     /* properties=("data source"="\\Pi693pf005\Ukraine_share\Conscensia_from_pa136\Roa\SAS\Kondor-OR\kondor.html") */

     properties=("data source"="http://pi693pa258/sn_drift/kondor_rettelse.nsf/6e2cd21bfc54bf41c12579790034d84d?OpenView&Count=10000...")

     provider_string="HTML Import";

     data imported;     

          set tmp."SAS-Eksport1"n;


But received next error:

     ERROR: Error trying to establish connection: Unable to Initialize: Cannot update.  Database or object is read-only.

     ERROR: Error in the LIBNAME statement.

The data on html page is table with a couple of rows and columns.

If I save *.html file physically from above URL, then everything works perfectly.

Can anyone help with such issue?

Super User
Posts: 10,410

Re: Read html from url with Libname OLEDB

After checking documentation, I found this. URL is not supported.


identifies the data source object (suchas a relational database server or a local file) to which you want to connect.


SAS Employee
Posts: 116

Read html from url with Libname OLEDB

Consider using PROC HTTP to download the results of your HTTP request.  You may be able to read thelocal copy using OLEDB.

Posts: 26

Read html from url with Libname OLEDB

Ok, thanx a lot. I manage to read data to physical file and then use oledb to create data set. Everything works fine.

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation