Date: Fri, 21 Jun 2002 14:44:49 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Subject: Re: url engine of filename
I expect that the FILENAME function can be used. In my experience, the
documentation is not always exhaustive. In other words, it does not say
that you cannot use URL/Web access method, so give it a try.
In my FTP Access Method paper, there are examples of using the FTP A.M. via
function calls. The coding for URL/Web A.M. should be similar.
On Fri, 21 Jun 2002 08:19:35 -0400, Mike Rhoads <RHOADSM1@WESTAT.COM> wrote:
>Might it work if you explicitly disassociate the fileref and then
>reassociate and reopen it, for each iteration? I would try this with an
>explicit DO-loop in the DATA step, rather than relying on the implicit DATA
>Perhaps you could do this with the FILEVAR option of the INFILE statement.
>You might need to switch the FILEVAR variable value to some dummy value and
>then switch it back.
>The other possibility that comes to mind is using the external file
>functions, such as FILENAME, FOPEN, and FCLOSE. FWIW, however, I didn't
>the URL option documented for the FILENAME function (as opposed to the
>All untested -- hope it helps!
>From: Peter Crawford [mailto:peter@CRAWFORDSOFTWARE.DEMON.CO.UK]
>Sent: Tuesday, June 18, 2002 9:29 AM
>Subject: url engine of filename
>I would like to read a web page to collect some exchange rates
>The url engine on a filename statement makes this easy
>%let url = http://uk.finance.yahoo.com:80/q?s=EURGBP%3dX&d=1b ;
>filename foo url "&url" lrecl=32000 ;
> if _n_ gt 100 then stop;
> infile foo dlm='<> ' n=200 ;
> now = datetime() ;
> input @'Last Trade' @ ;
> input @'br' trade_time ?? :time5. @;
> input @'Ask' @ ;
> input @'br' asking ??
> #1 @1 @@ ; /* get back to beginning ready for next iteration */
> put trade_time= : time. asking= now= : datetime. ;
> * if lag( trade_time ) ne trade_time then output ;
>What becomes more difficult is to presuade the web page to be refreshed
>when I remove that final *, only one obs is output;