BookmarkSubscribeRSS Feed
RomanA
Calcite | Level 5

Hello

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;

     run;

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?

3 REPLIES 3
Ksharp
Super User

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

http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001361171.htm

DATASOURCE=<'>data-source<'>

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

Ksharp

SASJedi
SAS Super FREQ

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

Check out my Jedi SAS Tricks for SAS Users
Yuriy2301
Calcite | Level 5

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

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
  • 3 replies
  • 1322 views
  • 0 likes
  • 4 in conversation