Your SAS programs, embedded in web apps and elsewhere

help: read html source code

Reply
N/A
Posts: 0

help: read html source code

I'm a newbie to the forum and a novice at SAS programming.

Problem:
All I need is to read in the html source code from any given website into SAS. My problem is connecting to the internet. I'm sure there is some way to do this. I currently only have release 8.02. Is that at problem? I've tried many different infiles but nothing is working.

If anyone out there could help that would be a great help. Thanks.

JPI
SAS Super FREQ
Posts: 8,743

Re: help: read html source code

Hi:
This is not really a stored process question. You could look in the documentation for information about the URL or HTTP access method on the FILENAME statement. Several of these access methods are described in these links to papers and the doc: [pre]http://support.sas.com/software/91x/lrdictwhatsnew900.htm
http://www.bassettconsulting.com/P6-27-01.pdf
http://www2.sas.com/proceedings/sugi30/100-30.pdf
http://www2.sas.com/proceedings/sugi28/073-28.pdf
[/pre]
These papers talk about different reasons and methods to read HTML pages with SAS. However, being able to read "ANY" website into SAS sounds like a technique called "screen-scraping" that we used to use when we didn't want to recode CICS screens. So we ran a product to scrape the information from a CICS data entry screen or information screen and use it elsewhere in our program. (My dim memory of this is that it was an enormous pain to scrape the info and use the scraped info correctly.)

Your best bet might be to talk to Tech Support and explain to them exactly what you need to do and they can help you find the best method to accomplish your task.
cynthia
N/A
Posts: 0

Re: help: read html source code

thanks.

where in this forum can I ask general questions about SAS programming.

jpi
SAS Employee
Posts: 285

Re: help: read html source code

SAS Institute does not have a forum for general SAS questions. If you would like to make suggestions for new forums, please send your comments to suggest@sas.com

There is a mailing list called "SAS-L" that is run by SAS customers. It is not affiliated in any way with SAS Institute.

You can find out more about SAS-L at:

http://www.listserv.uga.edu/archives/sas-l.html

Best regards,

Vince DelGobbo
SAS R&D
N/A
Posts: 0

Re: help: read html source code

I sent an email to request more forum topics.
Here is the code that I use. It works but it takes 1-5 minutes for one URL. I would like to shorten the time so it can read the data in seconds.

How can I modify this code to shorten the time. Is there a faster way? Is it slow because we don't have enough bandwidth or is more of a problem with my code? Maybe it takes so long because of security barriers? What do the experts think. Thanks again.

JPI

CODE:
filename connect url
"http://www.whitepages.com:80/10001/search/FindPersonfirstname_begins_with=1&firstname=Jared&name=Pratt&city_zip=&state_id=UT" debug;

data test;
infile connect length=len;
input record $varying200. len;
run;
SAS Employee
Posts: 285

Re: help: read html source code

I ran a similar request to this server, and SAS reported that it took 1.06 seconds of real time. The problem may be network-related at your site.

Vince DelGobbo
SAS R&D
Ask a Question
Discussion stats
  • 5 replies
  • 264 views
  • 0 likes
  • 3 in conversation