Date: Fri, 3 Dec 2010 11:43:24 -0800
Reply-To: "DUELL, BOB (ATTCINW)" <BD9439@ATT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "DUELL, BOB (ATTCINW)" <BD9439@ATT.COM>
Subject: Re: working with multiple URLs
In-Reply-To: <201012031833.oB3GDSc9013531@willow.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Try a SAS macro with PROC APPEND, something like this:
%macro getit(url);
proc delete data=getone; /*Safety first */
run;
filename dummy URL "&url";
data getone;
infile dummy;
input ...;
run;
filename dummy clear;
proc append base=alldata data=getone;
run;
%mend;
Then just run the macro for each site (deleting the collector first):
proc delete data=alldata;
run;
%getit(%str(http://www.data.com/pageone));
%getit(%str(http://www.data.com/pagetwo));
%getit(%str(http://www.data.com/pagethree));
Note the use of the %STR macro function, just in case your URL contains
special characters.
Bob
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jon
Sent: Friday, December 03, 2010 10:33 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: working with multiple URLs
I have a list of URL's that point to web pages with data, all with the
same
fields & formats, which I'd like to read into SAS. I know how to read
the
data from one URL (filename dummy URL 'http://www.data.com';) but am
stumped
as to how to cycle through a list of URLs and pull the data from those
pages
into one dataset. I could just do it one at a time but I'm sure there's
an
easier way and wondering if anyone in the SAS-L community can provide
some
pointers or code.
Best wishes,
- Jon