----- Original Message -----
From: Choate, Paul@DDS
To: SA
...@LISTSERV.UGA.EDU
Sent: Mon, 29 Dec 2003 16:23:05 -0800
Subject: Re: Reading the data from the Internet
Dea - Try this- this example brings in the NEMA sheet.
FILENAME website HTTP
'http://www.iso-ne.com:80/settlement-resettlement/SMD_operating_reserv...
mary/200311_OR_Summary.xls';
data file;
n=-1;
infile website recfm=s nbyte=n length=len;
input;
file "200311_OR_Summary.xls" recfm=n;
put _infile_ $varying32767. len;
run;
PROC IMPORT OUT= WORK.D200311_OR_Summary_NEMA
DATAFILE= "200311_OR_Summary.xls"
DBMS=Excel REPLACE;
RANGE="A3:G80";
sheet="NEMA"
getnames=yes;
RUN;
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: Dea Talu [mailto:deat...@hotmail.com]
Sent: Monday, December 29, 2003 1:17 PM
To: pcho...@DDS.CA.GOV
Subject: RE: Reading the data from the Internet
Hi Paul,
I tried, but I get a bunch of errors. Here is the log file:
60 FILENAME website HTTP
60 !
'http://www.iso-ne.com/settlement-resettlement/SMD_operating_reserves_...
y/
60 ! 200311_OR_Summary.xls';
61
62 data file;
63 infile website;
64 input;
65 file "excelfile.xls";
66 put _infile_;
67 run;
ERROR: Service httpd not found.
NOTE: The file "excelfile.xls" is:
File Name=C:\Documents and Settings\arotaru\excelfile.xls,
RECFM=V,LRECL=256
NOTE: 0 records were written to the file "excelfile.xls".
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE may be incomplete. When this step was
stopped
there were 0 observations and 0 variables.
WARNING: Data set WORK.FILE was not replaced because this step was stopped.
NOTE: DATA statement used:
real time 0.05 seconds
cpu time 0.02 seconds
68
69 PROC IMPORT OUT= WORK.excelfile
70 DATAFILE= "200311_OR_Summary.xls"
71 DBMS=Excel REPLACE;
72 GETNAMES=Yes;
73 RUN;
ERROR 22-322: Expecting a name.
ERROR 76-322: Syntax error, statement will be ignored.
ERROR: Import unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used:
real time 0.63 seconds
cpu time 0.24 seconds
I'll try a little bit more, maybe I can fix the problem. Thank you anyway!
Dea
>From: "Choate, Paul@DDS" <pcho...@DDS.CA.GOV>
>To: 'Dea Talu' <deat...@HOTMAIL.COM>, SA...@LISTSERV.UGA.EDU
>Subject: RE: Reading the data from the Internet
>Date: Mon, 29 Dec 2003 13:02:02 -0800
>Dea - Try something like this (untested)
>FILENAME website HTTP
>'http://website.com:80/dir/excelfile.xls';
>data file;
> infile website;
> input;
> file "excelfile.xls";
> put _infile_;
> run;
>PROC IMPORT OUT= WORK.excelfile
> DATAFILE= "excelfile.xls"
> DBMS=Excel REPLACE;
> GETNAMES=Yes;
> DATAROW=2;
>RUN;
>Hth
>Paul Choate
>DDS Data Extraction
>(916) 654-2160
>-----Original Message-----
>From: Dea Talu [mailto:deat...@HOTMAIL.COM]
>Sent: Monday, December 29, 2003 12:34 PM
>To: SA...@LISTSERV.UGA.EDU
>Subject: Reading the data from the Internet
>Hi,
>I have to get some data periodicaly from a website. Right now the way I get
>the data into SAS is by copying and pasting the information in a document
>and then by importing the document. The data is in Excel format; moreover,
>there are multiple sheets under the same webpage. I was wondering if there
>is any way to import the data automatically. Thanks a lot!
>Dea
>_________________________________________________________________
>Expand your wine savvy - and get some great new recipes - at MSN Wine.
>http://wine.msn.com
_________________________________________________________________
Enjoy a special introductory offer for dial-up Internet access - limited
time only! http://join.msn.com/?page=dept/dialup