Date: Tue, 7 Oct 2003 12:16:21 -0600
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: Include macros from the internet.
Content-Type: text/plain; charset=us-ascii
If he is certain that the URL will point to a well-formed macro, he
could just use something like:
=====
filename in url 'http://www.rohrbough-systems.com:80/ColList.inc'
proxy='http://slcpx01:8080';
%include in / source2;
=====
Tested code, but the proxy would need to be changed or deleted if used
elsewhere.
--
JackHamilton@FirstHealth.com
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV> 10/07/2003 10:47
AM >>>
Jean Balmisse <jean@REMOVE-THIS.STUDI.DK> wrote:
> I wonder if it is possible to include macros from the internet, if
they are
> available. That would make it a lot easier to use the same program
on
> different computers (if the paths are different).
>
> I've tried:
>
> %INCLUDE 'http:\\home.imf.au.dk\statbib\sasmacros\normgraf.mac'
>
> But it somehow doesn't work.
And it won't work. Well, not like that.
An important point to understand is that the INCLUDE statement is
reading a file off your system using standard internal I/O calls.
You are asking it to to understand the HTTP protocol, link to a
URL that might require some manner of DNS resolution, and then use
HTTP to read packets off the internet. Internally, that's very,
very different. It's like having your boss ask you to sit at your
desk and read a file written in Sanskrit that is locked in a file
cabinet in Nigeria, and telling you that "Oh you should be able to
do it since you can read the file sitting on your desk." (Note:
if your boss actually asks you to do something like this, immediately
check and see how pointy the boss's hair is. :-)
If you really want to do something like this, then consider using
the FILENAME statement with the URL engine to read in this macro,
then write it to your hard drive. At that point, you can read it
in using %INCLUDE .. unless it comes with headers, footers, javascript
code, HTML comments, or any of the other things which might not be
apparent when you look at the file using a browser.
You may be better off in the long run if you choose to use a browser
(or a program like Perl) to grab the file off the internet and save it
to your hard drive first, then inspect it for icky characters or
non-SAS code before running your SAS program.
HTH,
David
--
David Cassell, CSC
Cassell.David@epa.gov
Senior computing specialist
mathematical statistician